GetPropertyChangedSignal() not working

Hi, long story short, GetPropertyChangedSignal() isn’t working, I don’t really know how to use it either.

Part of localscript:

game.Players[script.Parent.Username.Text].Character.Humanoid.WalkSpeed:GetPropertyChangedSignal():Connect(function()
	script.Parent.SpeedCurrent.Text = ("Current Speed: "..game.Players[script.Parent.Username.Text].Character.Humanoid.WalkSpeed)
end)

Help is appreciated!

1 Like

Hi!

To use :GetPropertyChangedSignal(), you’ll need to provide the function with a property, in this case WalkSpeed. Instead of doing Humanoid.Walkspeed:GetPropertyChangedSignal(), you would have to use Humanoid:GetPropertyChangedSignal(“WalkSpeed”).

By applying this change your script would look like this:

game.Players[script.Parent.Username.Text].Character.Humanoid:GetPropertyChangedSignal("WalkSpeed"):Connect(function()
	script.Parent.SpeedCurrent.Text = ("Current Speed: "..game.Players[script.Parent.Username.Text].Character.Humanoid.WalkSpeed)
end)

For more information you can look at the page linked below!

2 Likes

It’s not firing. Do you know the cause of this? I pasted your code into mine.

Where is your local script located?

In a frame.

Don’t mind this

If there’s no errors, are you sure it’s able to find the right player and character?

Since I tested it out by making a local script in StarterCharacterScripts with the following code and it was working fine:

local Players = game:GetService("Players")

local Player = Players.LocalPlayer

local Character = Player.Character or Player.CharacterAdded:Wait()

Character:WaitForChild("Humanoid"):GetPropertyChangedSignal("WalkSpeed"):Connect(function()

local WalkSpeed = Character.Humanoid.WalkSpeed

print("Humanoid WalkSpeed has changed to: "..tostring(WalkSpeed))

end)

You should try printing the Player and Character. Perhaps something is going wrong there.