This module doesn’t let you speed up/slow down time when not in reverse. Please DM me if you know how to do that kind of stuff!
Ever wanted to reverse time, or speed it up or even slow it down? This module is for you!
You can get it here: https://www.roblox.com/library/5752328856/TimeModule
TimeModule:Track(BasePart part) -- Track the given object. TimeModule:Untrack(BasePart part) -- Stop tracking the given object. TimeModule:SetSpeed(unsigned integer speed) -- Set the speed. Only works when in reverse. TimeModule:IsReverse() -- Returns whether time is in reverse or not. TimeModule:Reverse() -- Reverse time. TimeModule:Unreverse() -- Unreverse time. Note that this doesnt replay all next frames, it lets time go back to normal after a reverse. TimeModule:Update(float deltaTime) -- Store the current position of all tracked parts.
Here’s an example script that should roughly show you how to use the module:
local runService = game:GetService('RunService') local players = game:GetService('Players') local player = players.LocalPlayer local timeModule = require(script.Parent:WaitForChild('TimeModule')) local button = script.Parent local char = player.Character or player.CharacterAdded:Wait() wait(1) -- wait for the character to spawn in, so we can track it too for _,v in ipairs(workspace:GetDescendants()) do if v:IsA('BasePart') then timeModule:Track(v) end end button.MouseButton1Down:Connect(function() timeModule:Reverse() timeModule:SetSpeed(2) end) while true do timeModule:Update(0.1) -- 0.1 is the delta time(time difference between every update) wait(0.1) end
This will reverse time with twice the speed once the button is clicked.
Want to help make this module better? Feel free to make a pull request here:
I hope you have fun programming with this module! I can’t wait to see the cool stuff you make with it.
Please tell me if you have any suggestions, or if you find bugs. Have a great day.
(sorry if the post is low-quality, i rushed it a bit)