im making a event which count players in a room every 1 min and send them message how much player in that room
i think i have that code but i cant make it work
any help ??
i think i have that code but i cant make it work
Code:
function onThink(interval, lastExecution, thinkInterval)
function pc()
for roomx = 995,998 do
for roomy = 1006,1009 do
roomsize = {x=roomx, y=roomy, z=7, stackpos=253}
local playercount = getThingfromPos(roomsize)
if playercount.itemid > 0 then
for _, pid in ipairs(playercount) do
playerc = playercount.type
doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, "There is "..playerc.." players in the event room.")
addEvent(pc,2000)
else
stopEvent(pc)
end end end
end
addEvent(pc,2000)
end
any help ??