I'm designing a shop GUI and I want the button to rotate infinitely when I mouse over it but when I tried to do certain things to make that happen nothing happened here's the script
function enter() script.Parent.Rotation = script.Parent.Rotation +5 end function leave() script.Parent.Rotation = 0 end script.Parent.MouseEnter:connect(enter) script.Parent.MouseLeave:connect(leave)
Use a loop.
local rotating = false function enter() rotating = true while rotating == true do script.Parent.Rotation = script.Parent.Rotation +5 wait(.1) --interval here end end function leave() rotating = false script.Parent.Rotation = 0 end script.Parent.MouseEnter:connect(enter) script.Parent.MouseLeave:connect(leave)