Hello, I'm making a script for a tool and in this script I made it so that when the player starts holding MB1, a power bar appears and starts to increase in power, but when the player releases MB1, the power bar is supposed to stop increasing its power. I'm trying to do that by making "InputEnded" change a boolvalue's value so that it can stop a while loop which is used to wind up a shot, except the while loop completely ignores it and keeps going. Any reason why?
#While loop in function not able to detect a boolvalue changing values
19 messages · Page 1 of 1 (latest)
inside the loop
check if boolvalue = false
then
break the loop
while is isHolding.Value == true do
shootPower.Value += 2
wait()
if isHolding.Value == false then
break
end
end
i think this gonna work
Didn't work
I'm gonna try to use remote events and see if that works
I just playtested and noticed that it's the "InputEnded" function that isn't changing the value to false
causing the while loop to never break