I've made this script that changes the players speed to the value in the leaderboards name called "speed" and I am trying to make sure that when their speed on the leaderboard is 0 then it would automatically put it to 16 until it goes above 16 however it only seems to stay at 16 the entire time
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
local humanoid = char:WaitForChild("Humanoid")
humanoid.WalkSpeed = player.leaderstats.speed.Value
if player.leaderstats.speed.Value <= 16 then
humanoid.WalkSpeed = 16
end
end)
end)
If you can explain to me what I've done wrong please do.
p.s I am new to scripting

2 comments
Thanks!
No problem!