LucasFerraz
Systems Analyst
I have this script
I have this script but it's not better way.
How to do that:
When player stepin script will if he is alone in area (The check will be each 30 seconds without stop, the first check will be 1 minute after stepin)
- if alone then reward
- if he isn't alone do nothing
If stepout cancel check
LUA:
local area = {frompos = {x=347,y=550,z=0}, topos = {x=466,y=653,z=8}}
local reward , count = 2665, 3
local players = 0
function onThink(cid, interval)
if(not isCreature(cid)) then
return
end
if isPlayer(cid) and isPlayer(target) then
for _,pid in ipairs(getPlayersOnline()) do
if (pid ~= cid) and isInRange(getThingPos(pid), area.frompos, area.topos) then
players = players+1
end
end
if players < 1 then
doPlayerAddItem(cid,reward,count)
end
end
return true
end
How to do that:
When player stepin script will if he is alone in area (The check will be each 30 seconds without stop, the first check will be 1 minute after stepin)
- if alone then reward
- if he isn't alone do nothing
If stepout cancel check