--Global Arerna -- g_arena=nil g_player=nil g_teamPod = { } g_teamCra = { } g_turret1 = { } g_turret2 = { } g_turret3 = { } g_podrewards = { } g_reploypod = nil function Arena_OnCreate(arena) -- Set our global value g_arena = arena -- Initialize random math.randomseed(os.time()) --Create Vendors end function test() local vech1 = g_arena:vehicle_create(411, 2188, 272, 99) --create trainer local vech2 = g_arena:vehicle_create(400, 2385, 277, 145) --create Certificate dealer vech1:setFrequency(65535) vech2:setFrequency(65535) g_arena:message("NPCS respawned Succseffuly") end function Player_OnDeath(killer, victim) -- player, player --Give them Attribute points. if (victim:getExperience() <= 25000) then -- If they kill someone with more than 25000 experience killer:message("You have gained 2 Attribute Points") killer:modPoints(2) -- Give them 2 Attribute Points elseif (victim:getExperience() <= 50000) then --If they kill someone with more than 50000 experience killer:message("You have gained 5 Attribute Points") killer:modPoints(5) -- Give them 5 Attribute Points elseif (victim:getExperience() <= 75000) then --If they kill someone with more than 75000 experience killer:message("You have gained 7 Attribute Points") killer:modPoints(7) -- Give them 7 Attribute Points elseif (victim:getExperience() <=100000) then -- If they kill someone with more than 100000 experience killer:message("You have gained 10 Attribute Points") killer:modPoints(10) -- Give them 10 Attribute Points elseif (victim:getExperience() >=100001) then -- If they kill someone with more than 100000 experience killer:message("You have gained 10 Attribute Points") killer:modPoints(10) -- Give them 10 Attribute Points end --Check if they have enough Attribute Points and remind them how to spend them. if (killer:getPoints() >= 50) then -- if they have 40 or more attribute points. killer:message("You currently have 10 or more Attribute points, ") killer:message("I suggest typing ?attribute if you have forgotten how to use them.") end end function loc(plyr) local c = plyr:coords() plyr:message("X = " .. c.x .. " Y = " .. c.y .. " Rotation = " .. c.rotation) end function att() local tor = g_arena:getPlayer("Toriad") tor:modPoints(25) tor:message("you have 50 points!") end function Player_OnJoin(player) if (noSkills(player) == true)then player:inventory_modify("Soldier",1) player:message("It would seem you have never played Infantry RPG before, if this is true please type ?tutorial") else player:message("Welcome back to Infantry RPG " .. player.m_name .. ", type in ?login to join the world") end end function Player_OnUnspec(player) -- player player:message("You need to type ?login") return false end function noSkills(player) -- Finds out if a player has skills if (player:skillFind(1) == false) then if (player:skillFind(10) == false) then return true end return false end end function Msg_OnCommand(plyr, command, payload, recipient, msg_type) -- player, string, string, string, integer local player = plyr local ore = "" local style = "" local team_n = "" local team_p = "" local password = math.random(1,1000) -- string.len("string") returns length of the string -- string.find("string", ":") returns the position of the character found -- if not found then returns nil. Starts at 1. -- string.sub("string", 1, 4) returns "stri", first index is the -- starting position and last index is the ending position -- string.sub("string", 4) returns "ing", with one argument -- the function starts from the index and goes to the end if (command == "?tutorial")then --Tutorial Command player:message("Welcome to Infantry RPG, you will soon get used to ") player:message("the style of gameplay however here are the basics.") player:message("You will first notice you are your on team this is ") player:message("because I am trying to keep a very RPG feel to this game.") player:message("If you wish to team up with other people you will need ") player:message("to goto a tavern in one of the many cities and type ") player:message("?party 'The Name of the Party:Password if any' without the '.") player:message("You get money and experience by killing other people or ") player:message("mining and selling the resources back to the local NPC purchaser.") player:message("There are 4 ways to advance your character in this Zone. ") player:message("Training, Certifications, Permissions, and Class Changes.") player:message("Each way has its pros and cons, by visiting a trainer in ") player:message("a city you can recieve training which will allow you to use different weapons.") player:message("Certifications work the same as training however you ") player:message("might be required to get both in order to get a new class or use new weapons.") player:message("Permissions allow you to do certain things such as build things, ") player:message("drive certain vehicles and to get aura bonuses.") player:message("Class Changing in this zone is different than any other zone, ") player:message("first you must reach the requirements of that ") player:message("class then you must find a trainer in the ") player:message("city, and ask him to change your class. ") player:message("Then you will be asked a couple of simple questions ") player:message("about your decision to change classes and then allowed to change."); player:message("When you are ready to join the game type ?login .") end if (command == "?login")then if (noSkills(player) == true)then player:inventory_modify("Soldier",1) player:message("It would seem you have never played Infantry RPG before, if this is true please type ?tutorial") end player:unspec(player.m_name,"" .. password) end if (command == "?attribute") then plyr:message("Each Attribute costs you 40 points. for list of attributes type ?list attributes.") plyr:message("In order to purchase an attribute type ?levelup 'name of attribute'") end if (command == "?list") then -- If they are asking for a list if (payload == "attributes") then -- If that list is attributes. plyr:message("Agility") plyr:message("Endurance") plyr:message("Health") plyr:message("Intelligence") plyr:message("Reflexes") plyr:message("Strength") else plyr:message("?list ") end end if (command == "?levelup") then -- If they are trying to level up something if (payload == "Agility" or payload == "agility") then -- If they are trying to level up Agility if (plyr:getPoints() >= 50) then -- Do they have enough Attribute points? plyr:modPoints(-50) plyr:inventory_modify("Agility", 1) plyr:message("Your Agility has increased by 1") else plyr:message("You need " .. (50 - plyr:getPoints()) .. " more attribute points.") end elseif (payload == "Endurance" or payload == "endurance") then if (plyr:getPoints() >= 50) then -- Do they have enough Attribute points? plyr:modPoints(-50) plyr:inventory_modify("Endurance", 1) plyr:message("Your Endurance has increased by 1") else plyr:message("You need " .. (50 - plyr:getPoints()) .. " more attribute points.") end elseif (payload == "Health" or payload == "health") then if (plyr:getPoints() >= 50) then -- Do they have enough Attribute points? plyr:modPoints(-50) plyr:inventory_modify("Health", 1) plyr:message("Your Health has increased by 1") else plyr:message("You need " .. (50 - plyr:getPoints()) .. " more attribute points.") end elseif (payload == "Intelligence" or payload == "intelligence") then if (plyr:getPoints() >= 50) then -- Do they have enough Attribute points? plyr:modPoints(-50) plyr:inventory_modify("Intelligence", 1) plyr:message("Your Intelligence has increased by 1") else plyr:message("You need " .. (50 - plyr:getPoints()) .. " more attribute points.") end elseif (payload == "Reflexes" or payload == "reflexes") then if (plyr:getPoints() >= 50) then -- Do they have enough Attribute points? plyr:modPoints(-50) plyr:inventory_modify("Reflexes", 1) plyr:message("Your Reflexes has increased by 1") else plyr:message("You need " .. (50 - plyr:getPoints()) .. " more attribute points.") end elseif (payload == "Strength" or payload == "strength") then if (plyr:getPoints() >= 50) then -- Do they have enough Attribute points? plyr:modPoints(-50) plyr:inventory_modify("Strength", 1) plyr:message("Your Strength has increased by 1") else plyr:message("You need " .. (50 - plyr:getPoints()) .. " more attribute points.") end else plyr:message("?levelup ") end end if (command == "?craft") then if (string.len(payload) > 0) and (string.find(payload, ":") ~= nil) then ore = string.sub(payload, 1, (string.find(payload, ":") - 1)) style = string.sub(payload, (string.find(payload, ":") + 1)) else plyr:message("No Payload. E.X. ?craft :