--Global Arerna -- g_arena=nil g_player=nil function Arena_OnCreate(arena) -- Set our global value g_arena = arena -- Initialize random math.randomseed(os.time()) end function Player_OnJoin(player) if (player.m_name == "Toriad") then g_arena:message("Your almighty God has entered! Worship him") else g_arena:message("" .. player.m_name .. " has joined") end end function Player_OnDeath(killer,victim) if (IsInRadiusOfCommander(player) == true) then player:inventory_modify("OneExperience",200) --Prize them 200 experience(using items that give exp) player:message("You killed someone, and because you were in the aura of a commander you gained 200 extra xp") end end function IsInRadiusOfCommander(player) local coords = player:coords() local radius = 10 local playersInArea = { } --make a table which will hold the players in the area local numberOfPlayers = g_arena:GetPlayersInArea(playersInArea, coords.x, coords.y, radius) for i = 1, numberOfPlayers do local possibleCommander = playersInArea[i] if (possibleCommander:getTeam().m_name == player:getTeam().m_name) then if (possibleCommander:getVehicle():vehiclename() == "Commander") then return true end end end return false end