Bool Value Not Changing

Hello,
So I have this issue in which I’m trying to set a bool value to false, but by some reason it’s not working, it’s a server script and I have already added some prints to make sure the script was going trough and it is, the output isn’t showing any errors, anyways any help is appreciated.

Bank:WaitForChild("Values").Robbery.Changed:Connect(function()
	if Bank:WaitForChild("Values").Robbery.Value == true then
		for RobTime = 1, Bank.Values.RobTime.Value do
			task.wait(1)
			print(RobTime)
			if RobTime == Bank:WaitForChild("Values").RobTime.Value then
				Bank.Values.Cooldown.Value = true
				print("Cooldown")
				wait(Settings.Bank_Config.Cooldown * 60)
				Bank.Values.Cooldown.Value = false
				print("Not Cooldown")
			end
		end
	end
end)
1 Like

task.wait(Settings.Bank_Config.Cooldown.Value * 60)

  1. use task.wait

  2. this might fix it try it

1 Like

Do any of those prints print out? At what spot does it error?

1 Like

It shows an error of the value is not been found?
Did you try to see in the console if print actually prints out?

1 Like

Yeah both prints are showing up in the console but the value isn’t changing

Nope, it doesn’t shows any error and the prints do show up in the console

Just tried but nothing changes

Could we see the rest of your script? There might be an issue with something else.

Can you try putting

Bank:WaitForChild("Values").Robbery:GetPropertyChangedSignal("Value"):Connect(function()

Instead of

Bank:WaitForChild("Values").Robbery.Changed:Connect(function()

???

Just tried but everything stays the same

Since you said that both of the prints show up, I’m really confused as to why your script isn’t working. If both prints showed up, this means that the line of code that changes your cooldown value to false should have been processed.

Maybe check and make sure that your cooldown value is actually a bool value and not anything else? Maybe you overlooked the cooldown value’s type/class.

So I had to use a string value instead of bool value as everything I tried didn’t had any success, anyways thanks to everyone who tried to help me.