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 7 years ago
Edited 7 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

while script.Parent.Parent.Parent.Parent.Parent.Sound.TimePosition < 5 and script.Parent.Parent.Parent.Parent.Parent.Sound.TimePosition > 0.1 do
    wait()
    script.Parent.Value = 1
end

while script.Parent.Parent.Parent.Parent.Parent.Sound.TimePosition > 5 or script.Parent.Parent.Parent.Parent.Parent.Sound.TimePosition == 0 do
    wait()
    script.Parent.Value = 0
end

SCRIPT INSIDE THE PARTS THAT ARE MEANT TO ROTATE

while true do
    wait()
        while script.Parent.Parent.Value.Value == 1 do
        script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(0,0.1,0)
        wait()
        end
    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