Advertisement
Guest User

Untitled

a guest
Feb 18th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. --[[
  2. Script Name: PM With Players On Screen
  3. Description: Check for players on screen and pm to other character with their names
  4. Author: Ascer - example
  5. ]]
  6.  
  7. local RECEIVER = "Main Character" -- character to receive messages.
  8. local SAFE_LIST = {"friend1", "friend2"} -- avoid sending message with your friends
  9. local INSTANT = true -- send message always or only when a new player enter on screen
  10.  
  11. -- DON'T EDIT BELOW THIS LINE
  12.  
  13. local storage = {}
  14.  
  15. Module.New("PM With Players On Screen", function ()
  16. local names, amount = "", 0
  17. for i, player in pairs(Creature.iPlayers(7)) do
  18. if not table.find(SAFE_LIST, player.name) then
  19. if not INSTANT then
  20. if not table.find(storage, player.name) then
  21. table.insert(storage, player.name)
  22. names = names .. player.name .. ", "
  23. amount = amount + 1
  24. end
  25. else
  26. names = names .. player.name .. ", "
  27. amount = amount + 1
  28. end
  29. end
  30. end
  31. if names ~= "" then
  32. Self.PrivateMessage(RECEIVER, "On screen (" .. amount .. ") " .. names, 3000)
  33. end
  34. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement