All pastes #768467 Raw Edit

generators

public lua v1 · immutable
·published 2007-11-10 17:20 UTC
rendered paste body
g_arena = nilg_t = { }g_gameTime = nilfunction 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 buildingsfunction 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	endend