Advertisement
scriptingtales

Server lock and Kick Others button test

May 2nd, 2022
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.61 KB | None | 0 0
  1. -- Gui to Lua
  2. -- Version: 3.2
  3.  
  4. -- Instances:
  5.  
  6. local ScreenGui = Instance.new("ScreenGui")
  7. local TextButton = Instance.new("TextButton")
  8. local KickButon = Instance.new("TextButton")
  9.  
  10. --Properties:
  11.  
  12. ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  13. ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  14.  
  15. TextButton.Parent = ScreenGui
  16. TextButton.BackgroundColor3 = Color3.fromRGB(83, 255, 27)
  17. TextButton.Position = UDim2.new(0.0241666697, 0, 0.25333336, 0)
  18. TextButton.Size = UDim2.new(0, 200, 0, 50)
  19. TextButton.Font = Enum.Font.SourceSans
  20. TextButton.Text = "Server Unlocked"
  21. TextButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  22. TextButton.TextScaled = true
  23. TextButton.TextSize = 14.000
  24. TextButton.TextWrapped = true
  25.  
  26. KickButon.Name = "KickButon"
  27. KickButon.Parent = ScreenGui
  28. KickButon.BackgroundColor3 = Color3.fromRGB(28, 222, 255)
  29. KickButon.Position = UDim2.new(0.024166666, 0, 0.362666667, 0)
  30. KickButon.Size = UDim2.new(0, 200, 0, 50)
  31. KickButon.Font = Enum.Font.SourceSans
  32. KickButon.Text = "Kick Others"
  33. KickButon.TextColor3 = Color3.fromRGB(255, 255, 255)
  34. KickButon.TextScaled = true
  35. KickButon.TextSize = 14.000
  36. KickButon.TextWrapped = true
  37.  
  38. -- Scripts:
  39.  
  40. local function VASQOVX_fake_script() -- TextButton.LocalScriptSL
  41. local script = Instance.new('LocalScript', TextButton)
  42.  
  43. script.Parent.MouseButton1Click:Connect(function()
  44. print("Server Locked")
  45.  
  46. local player = game.Players
  47. local TextButton = game.StarterGui.ScreenGui.TextButton
  48.  
  49.  
  50. game.Players.PlayerAdded:Connect(function(player)
  51. player:Kick(player.Name.. ", the server has been unfortunately locked", print(player.Name.. " has attempted to join."))
  52. end)
  53.  
  54. script.Parent.ScriptDisabler.Disabled = false
  55. script.Parent.LocalScriptSL.Disabled = true
  56. end)
  57.  
  58.  
  59.  
  60. script.Parent.MouseButton1Click:Connect(function()
  61. local TextButton = script.Parent
  62.  
  63.  
  64. TextButton.BackgroundColor3 = Color3.fromRGB(252, 0, 6)
  65. TextButton.Text = "Server Locked"
  66. end)
  67. end
  68. coroutine.wrap(VASQOVX_fake_script)()
  69. -- TextButton.ScriptDisabler is disabled.
  70. -- TextButton.ScriptDisabler2 is disabled.
  71. local function JTJUOY_fake_script() -- KickButon.LocalScript
  72. local script = Instance.new('LocalScript', KickButon)
  73.  
  74. local player = game.Players.ImNoobie12Dojo -- Replace your name!!!
  75. local others = game.Players
  76.  
  77.  
  78.  
  79. game.Players.PlayerAdded:Connect(function(player)
  80. print("Welcome", player.Name)
  81. end)
  82.  
  83. game.Players.PlayerAdded:Connect(function(others)
  84. others:Kick("ImNoobie12Dojo has kicked others.", print("Other players have been kicked"))
  85. end)
  86. end
  87. coroutine.wrap(JTJUOY_fake_script)()
  88.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement