basically I wanna change an IntValue to a Player's Walkspeed, But I cant seem to reference the player... Can anyone tell me how?
COMMUNITY QUESTION
How do you reference a humanoid?
3 answers
This question was already asked and answered.
https://scriptinghelpers.org/questions/100912/how-to-reference-a-players-humanoid
If it's in a local script, first learn how to get the local player, then the character. Then you can access the humanoid and setup the event to fire whenever the property changes!
There are many ways to reference a humanoid. If you're making a leaderboard script, I assume you have some code that triggers when a player joins the server. From that, you can get the player's character and then their humanoid
Here's a quick example:
game:GetService('Players').PlayerAdded:Connect(function(player)
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:FindFirstChildOfClass('Humanoid')
local leaderstats = Instance.new('Folder')
leaderstats.Name = 'leaderstats'
leaderstats.Parent = player
local speed = Instance.new('IntValue')
speed.Name = 'Speed'
speed.Parent = leaderstats
speed.Value = humanoid.WalkSpeed
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Please specify?
Well, I am making Leaderstats, and the leaderstats value is an Int Value. But the Int Value has to be equal to the WalkSpeed of a humanoid, But I dont know how to reference a humanoid.