I made it where a part spins using the CFrame.
while wait() do
script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(0,0.1,0)
Player.Character.Humanoid.Died:Connect(function()
wait(2)
break
end
end
I was wondering how I could stop it from spinning and break the loop. The script above is giving me an error saying that the “break” statement is outside of the loop. Im trying to make it where when the player dies, the loop breaks. Is there anyway to fix this?