Help with Values Reset System

So I’m making a basketball game and I’m trying to reset the Values of the basketball if a player leaves while handling the ball. Part of the function works but this is a snippit of the part that doesn’t work. It prints everything with no errors the only problem is the actual bool and stiring values don’t change. I have a picture of the output below too.

if PlayerInfo[ Player.Name ].Values.Has_Ball then -- Refencing a Stats module i use 
		for _,Basketball in pairs(game:GetService("CollectionService"):GetTagged("Basketball")) do 
			local Values = Basketball:WaitForChild("Values")
			if Values.BallHandler.Value == Player.Name then 
				Values.BallHandler.Value = "" ; print(Values.BallHandler.Value)
				Values.CanPickup.Value = true ; print(tostring(Values.CanPickup.Value))
				Basketball:SetNetworkOwner(nil) 
				print("BallReset")
				
			end
		end
	end

image

I think it’s printing the Values before they change since you have print next to them

try adding a wait(1) after the value changes

I check the values in the explorer too and they still don’t change since this fires when a player resets with the ball too

wait I just noticed something. it does print out what you wanted the script to print did you forget to change the CanPickup.Value to false? otherwise screenshot the explorer.

Ill try again hold on but I want it to be true not false

Ok So I tried using a while loop to change the value but It still didn’t work so im going to report this in the problems tab in the forum it’s printing but it’s not actually changing

this is what i did by the way
image

if PlayerInfo[ Player.Name ].Values.Has_Ball then
		for _,Basketball in pairs(game:GetService("CollectionService"):GetTagged("Basketball")) do 
			local Values = Basketball:WaitForChild("Values")
			if Values then print("Yes") end
			if Values.BallHandler.Value == Player.Name then 
				repeat Values.BallHandler.Value = "" ; Values.CanPickup.Value = true ; Basketball:SetNetworkOwner(nil)
				until Values.BallHandler.Value == "" and Values.CanPickup.Value == true
				print(Values.BallHandler.Value..tostring(Values.CanPickup.Value))
				print("BallReset")
				
			end
		end
	end

That’s weird, are you sure they’re not changing? because it should be changing otherwise there would be an error. a BoolValue that’s true should look like this

image

This is what I see
Testing Place - Roblox Studio (gyazo.com)

I’m super confused as to what the problem is therefore im going to post this in feedback of the dev forum