g_arena = nil g_t = { } g_gameTime = nil function Arena_OnCreate(arena) g_arena = arena math.randomseed(os.time()) end --Record coords when making a gen, check to see if they are close enough to a gen when making buildings function Player_OnWarpItem(plyr, itemid, target) local n = 1 if (itemid == 7) then if (t[n] == nil) then c = player:coords() table.insert(c,1) arena:vehicle_create(52,c.x, c.y, 1) else n + 1 = n elseif (itemid == 8) then local pc = player:coords() local c = t[n] if (pc < c.x) and (pc > c.x + 250) and (pc > c.x) and (pc < c.x - 250) and (pc < c.y) and (pc > c.y + 250) and (pc > c.y) and (pc < c.y - 250) then arena:vehicle_create(51, pc.x pc.y,1) else player:message("There are no generators to power this.") end end end