Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

[SOLVED] :GetPropertyChangedSignal() not detecting when a value changes?

I'm using a (server)script in a gui to change the value of a NumberValue located in workspace. The gui's script runs fine but this script just doesn't seem to pick it up. The print() statement in line 2 doesn't even print anything!

Here's the code that doesn't seem to be working:

Values.Damage:GetPropertyChangedSignal("Value"):Connect(function(changed)
	print("My damage has been changed!")
	if Values.Damage.Value == 40 then
		print("My damage has been upgraded!")
		script.Parent.Mace2.Transparency = 0
		script.Parent.Mace.Transparency = 1
	elseif Values.Damage.Value == 55 then
		print("My damage has been maxed!")
		script.Parent.Mace3.Transparency = 0
		script.Parent.Mace2.Transparency = 1
		script.Parent.Mace3.OrinthianTrail.Enabled = true
	end
end)

I need a solution that's not too hard on a computer, as my game is already kinda rough on my PC.

2 comments

0

how about remembering to put another bracket at the end of line 1?

0

No, the bracket is at the function's end. You don't close the bracket until you end the function.

1 answer

Turns out that there was a script overriding stuff, I've fixed the problem now. Sorry for bothering everyone!

This discussion is preserved as it was. New answers, comments, and votes are closed.