Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 2 years ago
Edited by imKirda 2 years ago

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.

0
how about remembering to put another bracket at the end of line 1? sne_123456 439 — 2y
0
No, the bracket is at the function's end. You don't close the bracket until you end the function. TheB4dComputer 100 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago

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

Ad

Answer this question