• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Help with reward!

Ninja Bodil

New Member
Joined
Mar 7, 2009
Messages
116
Reaction score
0
Oki. I need a script that give you an item when you're the only one left in last man standing. (Hope you know what I mean otherwise ask).
 
Add this in "data\globalevents\globalevents.xml"
Lua:
	<globalevent name="LSM Reward" interval="30" script="lsm reward.lua"/>

Create a file in "data\globalevents\scripts" named "lsm reward.lua" and input this:
Lua:
function roomCheck()

	--[[IMPORTANT INFORMATION FOR CHANGING ROOM:	
		Put the smaller numbers in fromX, fromY, fromZ 
		Put the bigger numbers in toX, toY, toZ
	]]

	local room = {
		fromX = 666,
		fromY = 667,
		fromZ = 6,
		toX = 1337,
		toY = 1338,
		toZ = 9
	}

	local reward = 2160

	local amt_of_ppl = 0
	local winner = 0
	for x = room.fromX, room.toX do
		for y = room.fromY, room.toY do
			for z = room.fromZ, room.toZ do
				local pos = {x=x, y=y, z=z, stackpos=253}
				local thing = getThingFromPos(pos)
				if thing.itemid > 0 then
					if isPlayer(thing.uid) == true then
						amt_of_ppl = amt_of_ppl + 1
						winner = thing.uid
					end
				end
			end
		end
	end

	if amt_of_ppl == 1 then
		doPlayerAddItem(winner, reward, 1, TRUE)
		doPlayerBroadcastMessage(winner, "Woot, I am the last one standing!")
	end

function onThink(cid, interval)
	addEvent(roomCheck, 0)
	return true
end
 
Last edited by a moderator:
Back
Top