ServerScriptService
local player = game.Players.LocalPlayer local player2 = player.Character.Humanoid while wait() do player2.WalkSpeed = 16 + player.leaderstats.Cash.Value end
You should give the game a few seconds to load the character. It shows as nil because the character probably hasn't loaded in yet. Try adding a wait(2) at the beginning of your script.
The humanoid probably has not loaded in yet, instead of using:
local player2 = player.Character.Humanoid
Try using:
local player2 = player.Character:WaitForChild('Humanoid')
The problem is you're using LocalPlayer in a serversided script. LocalPlayer is only available for LocalScripts, so convert your serversided script into a local script and you'll be fine.