Why doesn't my local script print when the boolvalue's value is changed?

Hi! I want to print something from a local script inside the player’s character when a boolvalue inside the local script is changed. I’m trying to do it by using GetPropertyChangedSignal but the problem is it does not work.
I tried using .Changed, I tried changing the value myself from the server mode, but nothing. Does anyone have any idea why the local script is not working?

Script inside the ProximityPrompt I’m using, which is working:

local prompt = script.Parent

prompt.Triggered:Connect(function(player)
	print("Activated")
	
	local grappleAction = player.Character:FindFirstChild("Grapple"):FindFirstChild("shouldGrapple")
	grappleAction.Value = true
	wait(1)
	grappleAction.Value = false
end)

Local Script inside the player character:

local Action = script.shouldGrapple

Action:GetPropertyChangedSignal("Value"):Connect(function(player)
	print("Client")
end)

There aren’t any errors in the Output.

Changes made on server doesn’t replicate to client so that’s why localscript doesn’t detect any changes.

1 Like

I thought it was the other way around(If you change something from the client such as a part’s color without using remote events then they won’t replicate to the server)?

Either way, I checked the value in client and server mode and it does change according to the script.

Actually you’re right, I mistaken the reason why it didn’t work. Now I look at it I believe it doesn’t work because localscript is a descendant of workspace and not parented by a character model so it doesn’t run the code inside it.

1 Like

The localscript is inside the player’s character. The game takes it from startercharacterscripts. The script is inside a ProximityPrompt which is inside a part.

Hmm then, can I ask what type of valuebase object is shouldGrapple?

1 Like

shouldGrapple is a BoolValue.

This works for me

Your code doesn’t look like the problem.

1 Like

This works! Thanks! I’m not sure why but I think it’s because I had it :GetPropertyChangedSignal:Connect. Thank you both for replying!

That shouldn’t have done anything. I tested :GetPropertyChangedSignal:Connect and there’s also a code snippet in the docs using the same format. At least it works I guess.

I don’t know, then. You’re right, at least it works.