Hello.
This script will execute the options that you enabled (PlaySound, FlashClient, etc.) only if a player that's on the list appears.
This script will execute the options that you enabled (PlaySound, FlashClient, etc.) only if a player that's on the list appears.
local DangerList = { "Player1", "Player2", "Player3" }
local Action = {
MultiFloor = true, -- Should it detect player on different floors?
Visible = false, -- Does player must be visible? It can detect players one sqm OUT of your screen.
PlaySound = false, -- Should it PLAY SOUND if detect a player?
FlashClient = false, -- Should it FLASH CLIENT if detect a player?
Logout = false, -- Should it LOGOUT if detect a player?
XLog = false, -- Should it XLOG (it also tries to logout first!) if detect a player?
PauseBot = false, -- Should it PAUSE BOT if detect a player?
LogPlayers = false, -- Should it LOG every player that appears on your screen?
PrintConsole = true, -- Should it LOG every player that appears on your screen?
}
table.lower(DangerList)
local Creatures = getcreatures('p')
for i,j in pairs(Creatures) do
if table.find(DangerList, j.name:lower()) ~= nil then
if Action.MultiFloor or (Action.MultiFloor == false and j.posz == posz) then
if Action.Visible == false or (Action.Visible and j.visible) then
if Action.PrintConsole then
print(j.name)
end
if Action.LogPlayers then
file.writeline(name .. " - PlayersOnScreen", date .. " - " .. formattedtime .. ": " .. j.name)
end
if Action.PlaySound then
playsound("alert_playeronscreen")
end
if Action.FlashClient then
flashclient()
end
if Action.Logout then
logout()
end
if Action.XLog then
xlog()
end
if Action.PauseBot then
pausebot(true)
end
end
end
end
end