Public feed #724854

Something

public lua v1 · immutable
Raw Edit
·published 2007-10-03 22:34 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 == '(insertitemidhere)') then			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=1, numberOfPlayers do		local player = g_arena:getPlayer(i)		if (player ~= nil) and (player:valid()) then			player: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