Public feed #725796

Mine

public lua v1 · immutable
Raw Edit
·published 2007-10-04 18:21 UTC
rendered paste body
 --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_OnWarpItem(plyr, itemid, target) -- player, integer, string		local warpitems = {3}		if (inarray(warpitems, itemid) == true) then		if (itemid == 3) then			g_arena:message('Break')			summonall(plyr:coords())		end	else		plyr:message('You have used an invalid warpitem')	end		return falseendfunction summonall(coords)	local numberOfPlayers = g_arena:numPlaying()		for i=2, numberOfPlayers do		local person = g_arena:getPlayer(i)		if (person ~= nil) and (person:valid()) then			person:inventory_modify('Summon All', -1)			person:warp(coords.x, coords.y, 0)		end	end	endfunction messagetoteam(team, message)	if (team ~= nil) then		for i=1, team:num() do			local player = team:get(i)			if (player ~= nil) and (player:valid()) then				player:message(message)			end		end	endendfunction inarray(array, value)		local valid = false	table.foreach(array, index)		if (index ~= value) then			valid = false		else			return true 		end	return false			end