My leaderstats :GetPropertyChangedSignal() doesn't work. Why?
I have a leaderboard script that inserts a folder called leaderstats. It also inserts a value called Money. I already have a "fake" money value in ServerStorage. That fake money value is actually real.
So, back to the main thing here. I have a part in the script that says
1 | local money = game.ServerStorage.PlayerStats:FindFirstChild(player.Name) |
2 | money:GetPropertyChangedSignal( "Value" ):Connect( function () |
3 | cash.Value = money.Value |
And yes, the leaderstats cash has a variable called Cash, if you were wondering. For some reason, when the money's value changes, the leaderstats cash doesn't change. Any help is appreciated.
Here's the rest of the script:
01 | game.Players.PlayerAdded:Connect( function (player) |
02 | local leaderstats = Instance.new( "Folder" ,player) |
03 | leaderstats.Name = "leaderstats" |
04 | local cash = Instance.new( "NumberValue" ,leaderstats) |
07 | local money = game.ServerStorage.PlayerStats:FindFirstChild(player.Name) |
08 | money:GetPropertyChangedSignal( "Value" ):Connect( function () |
09 | cash.Value = money.Value |
Any help is good