I have a script that rotates a valve.
script.Parent.ClickDetector.MouseClick:Connect(function(plr)
if script.Parent.Value.Value == false then
for i = 1, 45, 1 do
script.Parent.CFrame = CFrame.new(script.Parent.Position) * CFrame.Angles(math.rad(script.Parent.Orientation.X - 2),0,0)
wait()
end
else
for i = 1, 45, 1 do
script.Parent.CFrame = CFrame.new(script.Parent.Position) * CFrame.Angles(math.rad(script.Parent.Orientation.X + 2),0,0)
wait()
end
end
end)
The first time I click it, it works. Every time after it just kinda vibrates.
