Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Define a function to handle errors and log them to the Roblox output window
- local function handleError(errorMessage)
- warn("[ERROR]: " .. errorMessage)
- end
- -- Wrap the code in a pcall statement to catch any errors that may occur
- local success, error = pcall(function()
- -- Get the RunService from the ScriptContext and call SaveInstance on the Workspace
- local runService = game:GetService("RunService")
- runService:SaveInstance(game.Workspace)
- end)
- -- If an error occurred, handle it and log it to the output window
- if not success then
- handleError("SaveInstance may not be supported yet: " .. error)
- end
- -- themightycta
Advertisement
Add Comment
Please, Sign In to add comment