--- [[ Global Variables ]] ---------- g_arena = nil -- The global arena class, to avoid having to pass it around functions g_bGameRunning = false -- Is the game running? --- [[ Functions ]] ------- -- when the arena is created, it runs this function Arena_OnCreate(arena) g_arena = arena math.randomseed(os.time()) end -- Code in this function is carried out when the player joins function Player_OnJoin(player) player:message("Arrr! Welcome ta pirate zone, lad!") player:setstat(1, 1) end function Vehicle_OnProduce(user, menuitem) --Talk to him first.. if (menuitem == 0)then user:inventory_modify("Speak with Tavernkeep", -1) user:message("Reclick NPC please.") --Ask about adventure elseif (user:inventory_find("Speak with Taverkeep") > 0) then if (menuitem == 1) then user:message("I heard there was a treasure-loaded fortress around..") --NPC Spawns Bad Guys for quest.. g_arena:vehicle_create(vehicleID, xCoord, xCoord, rotation) elseif (menuitem == 2) then elseif (menuitem == 3) then elseif (menuitem == 4) then end end end