I have quite a simple problem but i dont know the solution.
I have a script where it rotates a part in a while loop and i want to stop the loop after 10 seconds
done = false
while true do
script.Parent.SeatsHandle.Orientation -= Vector3.new(0,1,0)
task.wait(0.00001)
if done == true then
break
end
end
wait(10)
done = true
done = false
task.spawn(function()
while not done do
script.Parent.SeatsHandle.Orientation -= Vector3.new(0,1,0)
task.wait(0.00001)
end
end)
wait(10)
done = true
task.spawn(function() -- creates and fires a coroutine
while done == false do -- fires until done is true
script.Parent.SeatsHandle.Orientation -= Vector3.new(0,1,0)
task.wait()
end
end)