PDA

View Full Version : Help - Logout with playerList on screen



jplevada
12-29-2016, 02:38 PM
Hello Guys, some one could help me?


I need to improve this scripts with logout, because I use it for train and some people let me in a trouble.

For this reason a need to logout when player at list on screen with safe zone.
Because this guys kill my monster when I'm training.








local playerList = {"Name1", "Name2", "Name3"}

local whiteList = false --if true, playerList will not trigger alarm and all other players will, if false, any name on playerList will trigger alarm but other players won't.

registerEventListener (TIMER_TICK, "onTick")

function onTick()

for i = CREATURES_LOW, CREATURES_HIGH do

local c = Creature.GetFromIndex(i)

if c:isOnScreen() and c:isPlayer() then

if (not whiteList and table.find(playerList, c:Name())) or (whiteList and not table.find(playerList, c:Name())) then

alert()

return

end

end

end

end