Using :Wait()
on an RBXScriptSignal (such as RunService.Stepped
) does not work as waiting a certain duration when a number is inserted in the first argument. This is why I suggest using math.noise
. However, your method here works perfectly find for random linear angular rotation, so just simply use this:
local Part = script.Parent
local RunService = game:GetService("RunService")
RunService.Stepped:Connect(function()
Part.LinearVelocity = Vector3.new(0, 0, 0)
end)
while task.wait(5) do
Part.AngularVelocity = Vector3.new(math.random(-30,30)/100, math.random(-30,30)/100, math.random(-30,30)/100)
end