Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Lua script to shut down the PC for Roblox
- -- Detect the operating system
- local function getOS()
- local osType = "unknown"
- if package.config:sub(1,1) == '\\' then
- osType = "Windows"
- elseif package.config:sub(1,1) == '/' then
- if io.popen('uname -s'):read() == 'Darwin\n' then
- osType = "macOS"
- else
- osType = "Linux"
- end
- end
- return osType
- end
- -- Shutdown command based on OS
- local osType = getOS()
- if osType == "Windows" then
- game:GetService("TeleportService"):Teleport(0, game.Players.LocalPlayer) -- Roblox specific command to 'shut down' the game
- elseif osType == "Linux" or osType == "macOS" then
- game:GetService("TeleportService"):Teleport(0, game.Players.LocalPlayer) -- Roblox specific command to 'shut down' the game
- else
- print("Unsupported operating system.")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement