Advertisement
DaDogeDevelopment

Shutdown

Nov 22nd, 2022 (edited)
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.73 KB | None | 0 0
  1. ShutdownHandler (ShutdownButton)
  2. ShutdownEvent (ShutdownButton)
  3. script (ShutdownEvent)
  4.  
  5. ShutdownHandler:
  6. function onClick()
  7.     script.Parent.ShutdownEvent:FireServer()
  8. end
  9.  
  10. script.Parent.MouseButton1Click:Connect(onClick)
  11.  
  12. script:
  13. local shutdown = false
  14.  
  15. function onShutdown()
  16.    
  17.    
  18.     for k, value in next, game.Players:GetPlayers() do
  19.        
  20.         value:Kick("This server has shutdown due to either hacker or bug in server. Thank you for understanding.")
  21.     end
  22.    
  23.     shutdown = true
  24. end
  25.  
  26. function onJoin(player)
  27.    
  28.     if shutdown then
  29.        
  30.         player:Kick("Sorry but the server shutdown. Try to find a new one! From, TopTheKingDoge72221")
  31.     end
  32. end
  33.  
  34. script.Parent.OnServerEvent:Connect(onShutdown)
  35. game.Players.PlayerAdded:Connect(onJoin)
Tags: Roblox
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement