Hello I was wondering if I could increase time.os in roblox. For example, if I was in trouble or something IRL i could increase time.os so that I don’t have to sit through the trouble. perhaps I could do some like speed increaser so I still experience time in real time but like sped up a bit and I want to be able to turn it off.
So when the user clicks the button on their screen it speeds up time.os by 1.2x then when they press stop it brings time.os back to 1
here is my current code however it doesn’t work
local originalTimeScale = 1
local speedUpFactor = 1.2
local timeScale = originalTimeScale
local function speedUpTime()
timeScale = timeScale * speedUpFactor
game.Workspace.TimeScale = timeScale
end
local function stopTimeSpeedUp()
timeScale = originalTimeScale
game.Workspace.TimeScale = timeScale
end
local button = script.Parent
button.MouseButton1Click:Connect(speedUpTime)
local stopButton = script.Parent.Parent.StopButton
stopButton.MouseButton1Click:Connect(stopTimeSpeedUp)