Code:
local player = game.Players.LocalPlayer local char = player.Character local hum = char:WaitForChild("Humanoid") local speed = hum.WalkSpeed if speed.Changed then script.Parent.Text = speed end
Error I get :
16:10:52.808 - Players.Krosloe.PlayerGui.ScreenGui.TextLabel.LocalScript:5: attempt to index local 'speed' (a number value)
What would I change for the textlabel to change everytime the client walkspeed changes. Thanks.
The issue you have is that the speed is a number value. There are also an event you are using incorrectly. Here's a quick fix:
local player = game.Players.LocalPlayer local char = player.Character or player.CharacterAdded:Wait() local hum = char:WaitForChild("Humanoid") hum:GetPropertyChangedSignal("WalkSpeed"):Connect(function() script.Parent.Text = tostring(speed) end)
Hope I helped!
Use this:
humanoid:GetPropertyChangedSignal(‘WalkSpeed’):Connect(callback)