Hey people, I’ m here to ask if anyone can help me make a Slow Time system for a game idea.
I have no code to show since well I didn’ t know where and how to start making this.
There really isn’ t much to specify just making time slower, physics, walkspeed etc…
Thanks to anyone who can help!
You can make the walkspeed slower by going to game settings.
making a slow time system is not the easiest task in the world, ill tell you now I’d do it.
a TimeSpeed numberValue in ServerScriptService to keep track of timeSpeed and allow easy access for other server scripts.
local function wait(num)
num = num or 0
local t = os.clock()
repeat task.wait() until os.clock()-t > num*(1/game.ServerScriptService.TimeSpeed.Value)
return true
end
would be used to replace the wait in all of your scripts, making the Slow Time effect affect scripts.
to detect change, id use
local OldtimeSpeed = 1
game.ServerScriptService.TimeSpeed.Changed:Connect(function()
...
OldtimeSpeed = timeSpeed
end)
then, I would alter items in workspace that would be affected via GetDescendants();
ParticleEmitters would have their TimeScales altered or Speed and Lifetime altered according to timespeed.
workspace’s Gravity would change according the change in timespeed
BasePart’s Velocity would be divided/multiplied according to the change in timespeed.
Humanoid WalkSpeed would be divided/multiplied according to the change in timespeed.
...
workspace.Gravity *= 1/OldtimeSpeed/timeSpeed
for _,obj in pairs(workspace.Gravity) do
if obj:IsA("BasePart") then
obj.Velocity /= OldtimeSpeed/timeSpeed
end
if obj:IsA("Humanoid") then
obj.WalkSpeed /= OldtimeSpeed/timeSpeed
end
end
...
some inaccuracies may appear, but alas, itll look as if time has been slowed.
some more script editing might be required to make the effect look complete, for example, the velocity in a car, blast pressure of explosions etc to support the timeSpeed factor.
RunService.TimeScale doesnt seem to exist, where did you get that from?
It could be ChatGPT, which makes mistakes like that. Also, the grammar at the start of their reply doesn’t match the grammar later on, which implies it was not written by them.
your right am i thinking RunService.Heartbeat
sorry doing a few things at once here
GPT is handy not going to lie.
it makes too many mistakes to be reliable without checking if the code works or not. It is not recommended to use ChatGPT to help others on the devforums (iirc?)
Did you really try to use ChatGPT to help me? I hope you didn’ t do that with other people. Please stop tryng to help me if you are gonna use an unreliable AI to help me or other people
Thank you so much! I will remake the code so that it’ s good for everyone to use and mark it as a solution. Obviously crediting you for your amazing help!
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.