Hello everyone! So I’m making a boss fight, but somethings not working.
while true do
wait()
if BossBegan.Value == true then
choosingKillPart()
end
end
So basically the script is waiting for BossBegan to be true. But the thing is it repeats the choosingKillPart function but I want it to happen only once. Please let me know if I can fix this. Thanks for reading!
If you only want the function to be run once then you can move it outside of the loop. Or get rid of the loop entirely.
-- If value is true, skip the if-statement and run the function.
-- If value is false, wait until it changes to true, then run the function.
if (not BossBegan.Value) then
BossBegan.Changed:Wait()
end
choosingKillPart()