Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Finding the speed of an object to play a sound?

Asked by 2 years ago

I am making a roller coaster train, and I am trying to make it so that when the speed is going fast enough, it plays a whooshing sound on a part, but my code doesn't seem to work (I am terrible at this stuff so it is probably obvious to other people what I'm doing wrong)

local speed = script.Parent.Velocity.Magnitude

while true do
if speed >=30 then
    script.Parent.Sound:Play()
    wait(1)
end
end

1 answer

Log in to vote
0
Answered by
enes223 327 Moderation Voter
2 years ago

hey you! have you ever heard of enes? if you are in trouble, better call enes!

Ad

Answer this question