PDA

View Full Version : Alarm if X player on screen (Player Name)



jollebollen
04-12-2016, 12:36 AM
Do a script like this exist?

Like if for example if player Eternal Oblivion enter screen, sound the alarm!

Thanks :)

dinmamma
04-26-2016, 07:02 PM
Do a script like this exist?

Like if for example if player Eternal Oblivion enter screen, sound the alarm!

Thanks :)


local PlayerList = {"Orc Warlord","Demon","Kharsek","Eternal Oblivion"}
Module.New('player alert', function(module)
local player = Self.GetSpectators(true)
for i =1, #player do
if table.contains(PlayerList, player[i]:Name()) then
alert()
module:Delay(2000)
end
end
end)

~Tziki~
05-30-2016, 10:28 AM
local PlayerList = {"Orc Warlord","Demon","Kharsek","Eternal Oblivion"}
Module.New('player alert', function(module)
local player = Self.GetSpectators(true)
for i =1, #player do
if table.contains(PlayerList, player[i]:Name()) then
alert()
module:Delay(2000)
end
end
end)

Any way to change this so that it plays alarm if someone comes on screen EXCEPT your friend?

Like i have a rune making farm, and want to know if someone comes on screen that isnt part of that farm.

Trykon
05-30-2016, 01:18 PM
It is a bit different
Local players the should be your farms
And set "if not table.contains..."
Should work

martintokio
05-31-2016, 09:55 AM
local whiteList = {
["CHAR NAME"] = true,
["CHAR NAME"] = true
}

Module.New("alarmwithwhitelist", function()
for name, cid in Creature.iPlayers() do
if (not whiteList[name]) then
alert()
end
end
end)