Advertisement
david12469

Shut down pc

May 30th, 2025 (edited)
14
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. -- Lua script to shut down the PC for Roblox
  2.  
  3. -- Detect the operating system
  4. local function getOS()
  5. local osType = "unknown"
  6. if package.config:sub(1,1) == '\\' then
  7. osType = "Windows"
  8. elseif package.config:sub(1,1) == '/' then
  9. if io.popen('uname -s'):read() == 'Darwin\n' then
  10. osType = "macOS"
  11. else
  12. osType = "Linux"
  13. end
  14. end
  15. return osType
  16. end
  17.  
  18. -- Shutdown command based on OS
  19. local osType = getOS()
  20. if osType == "Windows" then
  21. game:GetService("TeleportService"):Teleport(0, game.Players.LocalPlayer) -- Roblox specific command to 'shut down' the game
  22. elseif osType == "Linux" or osType == "macOS" then
  23. game:GetService("TeleportService"):Teleport(0, game.Players.LocalPlayer) -- Roblox specific command to 'shut down' the game
  24. else
  25. print("Unsupported operating system.")
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement