In a local script:
game.Players.LocalPlayer.CharacterAdded:Connect(function() local ll = game.Players.LocalPlayer.leaderstats.Sugar.Value while true do game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = tonumber(ll / 20) game.Players.LocalPlayer.Character.Humanoid.JumpPower = tonumber(ll / 20) end end)
It is meant to change the jump power and walk speed to the Sugar leaderstats divided by 10.
Thanks.
You'll want to revise your script into this:
game.Players.PlayerAdded:Connect(function()plr) local ll = plr:WaitForChild("leaderstats").Sugar.Value plr.CharacterAdded:Connect(function(char) while wait() do local human = char:WaitForChild("Humanoid") human.WalkSpeed = tonumber(ll / 20) -- You said that the value should be Sugar divided by 10, so these 20 should be 10s (unless that was a typo) human.JumpPower = tonumber(ll / 20) end end) end)
Make sure that the script is a gobal script and not local.
This script will run when a player joins your game. When the character loads in, the script will begin to look for the character's humanoid. Replacing while true do
with while wait() do
will stop you game from crashing. If you wanted to set the walkspeed and jumppower to Sugar didvided by 10, you'd set the 20's in the script to 10's.