--- [[ 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 Tavernkeep") > 0) then if (menuitem == 1) then user:message("I heard there was a treasure-loaded fortress around..") --Randomized NPC Spawn Bad Guys for quest.. itemrandx = math.random(-999, 999) itemrandy = math.random(-999, 999) g_arena:vehicle_create(50, basex + itemrandx, basey + itemrandy, 0) elseif (menuitem == 2) then elseif (menuitem == 3) then elseif (menuitem == 4) then end end end