Advertisement
Guest User

GlockScript for ROBLOX

a guest
Jul 24th, 2016
1,811
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.70 KB | None | 0 0
  1. groupID = 2788849 -- THIS IS HILTON'S GROUP ID, CHANGE IT IF THIS ISN'T FOR HILTON.
  2. minimumRankGlockAvoidance = 4 -- THIS IS THE REQUIRES NUMERICAL RANK TO JOIN THE SERVER WHILE IT IS GROUP LOCKED, I.E. AWAITING TRAINING.
  3. minimumRankGlockActivate = 14 -- THIS IS THE REQUIRED NUMERICAL RANK TO ACTIVATE THE GROUP LOCK I.E. A HIGH RANK.
  4.  
  5. game.Players.PlayerAdded:connect(function(plr)
  6. glockActivate = false
  7. debounce = false
  8.  
  9. local function showMessage(message)
  10. if debounce == false then
  11. debounce = true
  12. local hintScreenGui = Instance.new("ScreenGui", plr.PlayerGui)
  13. hintScreenGui.Name = "hintScreenGui"
  14. local hintFrame = Instance.new("Frame", plr.PlayerGui.hintScreenGui)
  15. hintFrame.Name = "hintFrame"
  16. hintFrame.BackgroundColor = BrickColor.new(0, 0, 0)
  17. hintFrame.BackgroundTransparency = 0.3
  18. hintFrame.Position = UDim2.new(-0.1, 0, 0.1, 0)
  19. hintFrame.Size = UDim2.new(0, 0, 0.1, 0)
  20. local notificationSound = Instance.new("Sound", plr.PlayerGui.hintScreenGui)
  21. notificationSound.SoundId = "rbxassetid://205310435"
  22. notificationSound:Play()
  23. hintFrame:TweenSize(UDim2.new(1.2, 0, 0.1, 0), "Out", "Quad", 2)
  24. local glockText = Instance.new("TextBox", plr.PlayerGui.hintScreenGui.hintFrame)
  25. glockText.Name = "glockText"
  26. glockText.BackgroundTransparency = 1
  27. glockText.BorderSizePixel = 0
  28. glockText.Size = UDim2.new(1, 0, 1, 0)
  29. glockText.Font = 5
  30. glockText.Text = ""
  31. glockText.TextColor3 = Color3.fromRGB(255, 255, 255)
  32. glockText.TextScaled = true
  33. local text = message
  34. wait(2)
  35. for i = 0, #text do
  36. glockText.Text = string.sub(text, 1, i)
  37. wait()
  38. end
  39. wait(2)
  40. local glockTextTransparency = 0
  41. while glockTextTransparency < 1 do
  42. glockTextTransparency = glockTextTransparency + 0.05
  43. glockText.TextTransparency = glockTextTransparency
  44. wait()
  45. end
  46. local backgroundTransparency = 0.3
  47. while backgroundTransparency < 1 do
  48. backgroundTransparency = backgroundTransparency + 0.05
  49. hintFrame.BackgroundTransparency = backgroundTransparency
  50. wait()
  51. end
  52. plr.PlayerGui.hintScreenGui:Destroy()
  53. debounce = false
  54. end
  55. end
  56.  
  57. plr.Chatted:connect(function(msg)
  58. if plr:GetRankInGroup(groupID) >= minimumRankGlockActivate then
  59. if msg == "-glock on" then
  60. if debounce == false then
  61. if glockActivate == false then
  62. glockActivate = true
  63. game.Players.PlayerAdded:connect(function(plr)
  64. for _,v in pairs (game.Players:GetChildren()) do
  65. if v:GetRankInGroup(groupID) < minimumRankGlockAvoidance then
  66. plr:Kick("This server is group locked.")
  67. end
  68. end
  69. end)
  70. if plr:GetRankInGroup(groupID) < minimumRankGlockAvoidance then
  71. plr:Kick("The server is group locked.")
  72. end
  73. showMessage("The server has been group locked!")
  74. end
  75. end
  76. elseif msg == "-glock off" then
  77. if debounce == false then
  78. if glockActivate == true then
  79. glockActivate = false
  80. showMessage("The server has been unlocked!")
  81. end
  82. end
  83. end
  84. end
  85. end)
  86. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement