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:
01 | game:GetService( 'Players' ).PlayerAdded:Connect( function (player) |
02 | local character = player.Character or player.CharacterAdded:Wait() |
03 | local humanoid = character:FindFirstChildOfClass( 'Humanoid' ) |
05 | local leaderstats = Instance.new( 'Folder' ) |
06 | leaderstats.Name = 'leaderstats' |
07 | leaderstats.Parent = player |
09 | local speed = Instance.new( 'IntValue' ) |
11 | speed.Parent = leaderstats |
12 | speed.Value = humanoid.WalkSpeed |