function meditation(moving,equipped)
while moving == false and equipped do
progress.Size = UDim2.new(0,0,1,-4)
progress:TweenSize(UDim2.new(1, -4, 1, -4),"Out","Linear",10,false)
if equipped == false or moving == true then
frame.Visible = false
break
end
wait(10)
updateMagic:FireServer(orbSize)
end
end
function moveDetect(speed)
if equipped then
if speed > 5 then
moving = true
meditating = false
print("moving")
else
moving = false
print("stoppedmoving")
end
end
end
The problem here is
if equipped == false or moving == true then
frame.Visible = false
break
end
only checks once so if moving = false while it checks once then during the 10second wait if moving turns true, it doesn't break the loop. How can i make it so that as soon as the char moves the while loop breaks?

2 comments
Can you show the code for the variables?
Use a while loop to keep checking and then break it when equipped is falsse or moving is true.