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