I have made a script to slow down gravity but now I want to slow down time but It would picked the object so many times until it freezes in mid air. Any help would be great since it would only work on one object before another object is made. I have also tried using {} but does not work even with one object.
local Slowspeed = 1.4
local SChild = nil
while wait(.25) do
for i, child in pairs(workspace:GetDescendants()) do
if child:IsA("BodyVelocity") and child ~= SChild then
SChild = child
child.Velocity = child.Velocity/ Slowspeed
print(child)
end
end
end
There are several methods you can use when it comes to tagging objects. For instance, you can use CollectionService.
local CollectionService = game:GetService("CollectionService")
local tagName = "slowed"
local Slowspeed = 1.4
local SChild = nil
while wait(.25) do
for i, child in pairs(workspace:GetDescendants()) do
if child:IsA("BodyVelocity") and not CollectionService:HasTag(child,tagName) then
CollectionService:AddTag(child,tagName)
child.Velocity = child.Velocity/ Slowspeed
print(child)
end
end
end