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

Why is this script not turning a specific part?

Asked by 8 years ago
Edited 8 years ago

EDIT: I fixed it by messing around with some variable and creating a BoolValue and using that to check it properly. All answers will not be needed. Thank you for you time

I am creating a dropper and when you drop a bucket in there, it plays a sound. This works but then I am making it so two unions turn (Both with the same script) when the sound is playing and when the sound has reached a certain TimePosition it will stop. Now I have gotten this code because the value auto set to 1 for some reason. Now it will not even rotate the part. Why?

SCRIPT INSIDE THE INTVALUE

1while script.Parent.Parent.Parent.Parent.Parent.Sound.TimePosition < 5 and script.Parent.Parent.Parent.Parent.Parent.Sound.TimePosition > 0.1 do
2    wait()
3    script.Parent.Value = 1
4end
5 
6while script.Parent.Parent.Parent.Parent.Parent.Sound.TimePosition > 5 or script.Parent.Parent.Parent.Parent.Parent.Sound.TimePosition == 0 do
7    wait()
8    script.Parent.Value = 0
9end

SCRIPT INSIDE THE PARTS THAT ARE MEANT TO ROTATE

1while true do
2    wait()
3        while script.Parent.Parent.Value.Value == 1 do
4        script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(0,0.1,0)
5        wait()
6        end
7    end

Here is image reference as how I am setting it out. Hopefully this is all the code you need to help me. Feel free to comment to ask for more code or point out a silly mishap.

Answer this question