#WalkSpeed Indicator GUI

1 messages · Page 1 of 1 (latest)

real lichen
#

I am trying to get the walkspeed indicator gui to show the character's walkspeed, and I couldn't figure how to get it to function

local textIndicator = script.Parent.Text


players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(char)
        local humanoid = char:WaitForChild("Humanoid")
        while wait() do
            textIndicator = ""..humanoid.WalkSpeed
        end
    end)
end)```
wind pond
#

so every time the walkspeed changes the gui label gets updated?

real lichen
#

I just want it to display the walkspeed whether changed or unchanged

wind pond
#

Once the character added event is called, you want to do 2 things:

  1. Start by setting the current humanoid walkspeed to the text label
  2. Create a "PropertyChanged" Signal connection, that way any future instances where you want to change the humanoid walkspeed, it will automatically gets updated
#

so like humanoid:GetPropertyChangedSignal("WalkSpeed"):Connect(functionThatUpdatesTheTextLabel)

real lichen
#

I did it but it still doesn't function

wind pond
#

show me

real lichen
#
local player = players.LocalPlayer
local textIndicator = script.Parent.Text


players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(char)
        local humanoid = char:WaitForChild("Humanoid")
        while wait() do
            textIndicator = ""..humanoid.WalkSpeed
        end
    end)
end)



player.Character.Humanoid:GetPropertyChangedSignal("WalkSpeed"):Connect(function()
    textIndicator = player.Character.Humanoid.WalkSpeed
end)```
wind pond
#

in here, you are listening if the property changed when you don't even know if the player character has loaded or not

toxic blazeBOT
#

studio** You are now Level 1! **studio

wind pond
#

one way to ensure that is to move the whole GetPropertyChanged signal function in the CharacterAdded event

real lichen
#

ah okay

wind pond
#

because characterAdded event fires when your character has loaded its contents (Body Parts, humanoid, accessories, etc)

real lichen
#

okay, I'll get that done

wind pond
#

don't use while wait() lol, it updates every frame even if the humanoid walkspeed doesn't change

#

not good

real lichen
#

okay thanks

toxic blazeBOT
#

studio** You are now Level 2! **studio