local whitelist = {
"FriendName1",
"FriendName2",
"FriendName3"
}
local function isInWhitelist(playerName)
for _, name in ipairs(whitelist) do
if playerName == name then
return true
end
end
return false
end
local function checkForPlayers()
local players = getScreenPlayers()
for _, player in ipairs(players) do
local playerName = getCreatureName(player)
if playerName and not isInWhitelist(playerName) then
playSound("playerOnScreen.wav")
break
end
end
end
autoRun(1000, checkForPlayers)
local function f()
if #getScreenPlayers() > 1 then
xlog()
sleep(1000)
end
end
autoRun(100, f)