Can't set variable to false in loop

So, I’m basically trying to set a variable false in a loop but it isn’t working and I need to use a loop for this anyways around this?


while Controls.up == 1 do
		local UpRay =, humrp.CFrame.lookVector * 5)
		local hitfront, position = game.Workspace:FindPartOnRayWithIgnoreList(UpRay, {head,humrp,hat})
		if not hitfront then
				print("There is nothing here.")
				repeat game:GetService("RunService").Stepped:Wait()
				Controls.up = 0 and print('sdfgsdf')
				until Climbing == false
				Climbing = false
				hum.PlatformStand = false
				local Ledge = TweenService:Create(humrp,, {CFrame = humrp.CFrame +,1.2,-3.5)})

You never localized the “hum” variable that is why.

Uh, sir that is just a piece of the code, I snipped, I defined “hum” earlier in the script, I assure you it’s not that

So this part of the script is the part that isn’t working?

Well, it’s working it just doesnt want to set the variable “Climbing” to false for some reason

Maybe add print statements to check if the previous code isn’t working.

Oh I fixed it, I had the repeat until before everything else thanks for the suggestions!

1 Like

You’re repeating until Climbing is false, but you are setting it to false afterwards (meaning it never gets set to false). I’m not sure what your script is meant to do but I’m pretty sure this is the probable reason.

Edit, guess I was too late lol

Yeah just figured that out, thanks!

Alright cool! (30 charsssssss)