Advertisement
Gomlsauresrex

SLock

Mar 23rd, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. local hint=Instance.new("Hint",workspace)
  2. local msg1="Now using SLock by Dev_Basics"
  3. local msg2="This now means that players cannot join this server"
  4. local msg3="To prevent specific players from getting kick add them to the whitelist"
  5. local msg3="type 'whitelist/playername' to add a player to the whitelist"
  6. local msg4="To disable Slock type 'slock/on'"
  7. local msg5="Thank you for using Slock by Dev_Basics"
  8.  
  9. local whitelist={}
  10. local slockenabled=true
  11. local num=1
  12.  
  13. hint.Text=msg1
  14. wait(5)
  15. hint.Text=msg2
  16. wait(5)
  17. hint.Text=msg3
  18. wait(5)
  19. hint.Text=msg4
  20. wait(5)
  21. hint.Text=msg5
  22.  
  23.  
  24. game.Players.ChildAdded:Connect(function(player)
  25. if slockenabled and not whitelist[player.Name] then
  26. hint.Text=player.Name.." attempted to join the server"
  27. workspace[player.Name]:Destroy()
  28. end
  29. end)
  30.  
  31. for _,player in pairs(game.Players:GetPlayers()) do
  32. player.Chatted:Connect(function(msg)
  33. if string.sub(msg, 1, 10) == "whitelist/" then
  34. whitelist[#whitelist+1]=string.sub(msg, 11)
  35. elseif string.sub(msg, 1, 6) == "slock/" then
  36. local txt=string.sub(msg, 7)
  37. if txt == "off" then slockenabled=false end
  38. end
  39. end)
  40. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement