zibbol

Untitled

Jul 31st, 2025
370
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.79 KB | None | 0 0
  1. local whitelist = {
  2.     "Aleksander Puszkin",
  3.     "Smiec Aa",
  4.     "FriendName3",
  5. }
  6.  
  7. local function isInWhitelist(playerName)
  8.     local selfName = getSelfName()
  9.     for _, name in ipairs(whitelist) do
  10.         if playerName == name then
  11.             return true
  12.         end
  13.         if selfName ~= nil and playerName == selfName then
  14.             return true
  15.         end
  16.     end
  17.     return false
  18. end
  19.  
  20. local function checkForPlayers()
  21.     local creatures = getCreaturesMultiFloor()
  22.     for _, creature in ipairs(creatures) do
  23.         local playerName = getCreatureName(creature)
  24.         if isPlayer(creature) and playerName and not isInWhitelist(playerName) then
  25.             playSound("playerOnScreen.wav")
  26.             break
  27.         end
  28.     end
  29. end
  30.  
  31. autoRun(100, checkForPlayers)  
Advertisement
Add Comment
Please, Sign In to add comment