game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Char)
while true do
task.wait(2)
Player.leaderstats.Speed.Value = Char.Humanoid.WalkSpeed
Player.leaderstats.JumpPower.Value = Char.Humanoid.JumpPower
end
end)
end)
Hey there, I want the leaderstats to display the player’s walkspeed and jumppower. However, it doesn’t update.
local Players = game.Players
Players.PlayerAdded:Connect(function(Player)
local leaderstats = Instance.new("Folder", Player)
leaderstats.Name = "leaderstats"
local WalkSpeed = Instance.new("IntValue", leaderstats)
WalkSpeed.Name = "WalkSpeed"
local JumpPower = Instance.new("IntValue", leaderstats)
JumpPower.Name = "JumpPower"
Player.CharacterAdded:Connect(function(Char)
local Humanoid = Char:FindFirstChild("Humanoid")
WalkSpeed.Value = Humanoid.WalkSpeed
JumpPower.Value = Humanoid.JumpPower or Humanoid.JumpHeight
end)
end)
Edit: I looked and noticed you were talking about Saving.
Here is a LocalScript so the stats constantly update for the Player:
StarterCharacterScripts:
local Char = script.Parent
local Hum = Char:FindFirstChild("Humanoid")
local ls = game.Players.LocalPlayer:WaitForChild("leaderstats")
while wait() do
ls.WalkSpeed.Value = Hum.WalkSpeed
ls.JumpPower.Value = Hum.JumpPower or Hum.Jumpheight
end
Also make sure that you change the walk speed/jump height from the server and not the client, since the server doesn’t recognize changes from the client.
I tried that as well, did many tests and workarounds, doesnt work either. Even after improving it, it didnt work. I have an idea ill try but i do not have the time right now so ill do it later
It worked perfectly for me. Are you changing the humanoid’s walk speed/jump force from a LocalScript?, if you are it wont work because you are changing it from the client and not the actual server.
im doing it from the server script service, i tested it before, didnt work.
also i clearly said:
@Inpultion
After Testing with your script, I checked it again and yes, it does work, but this works as well:
local Players = game.Players
Players.PlayerAdded:Connect(function(Player)
local leaderstats = Instance.new("Folder", Player)
leaderstats.Name = "leaderstats"
local WalkSpeed = Instance.new("IntValue", leaderstats)
WalkSpeed.Name = "WalkSpeed"
local JumpPower = Instance.new("IntValue", leaderstats)
JumpPower.Name = "JumpPower"
Player.CharacterAdded:Connect(function(Char)
local Humanoid = Char:FindFirstChild("Humanoid")
WalkSpeed.Value = Humanoid.WalkSpeed
JumpPower.Value = Humanoid.JumpPower
while wait() do
WalkSpeed.Value = Humanoid.WalkSpeed
JumpPower.Value = Humanoid.JumpHeight
end
end)
end)
It doesn’t update update peoples leaderstats all a once, just the LocalPlayer, the changes appears on both clients and only applies it to one person, i was on the right track with my other posts but i used the client instead of the server.
I’m getting a little confused about what you’re not trying to achieve. Are you trying to give each player their own leaderstat, and have the values changed within (walk speed/jump force) be the player’s own walk speed/jump force. Or are you trying to get all the players leaderstats to be the same as one specific player? I assume it’s the first one but I tested it on a 2 client and 1 server test. It worked just as intended. I Changed player 1’s humanoidjump force and got the expected result of both clients seeing the same value on their ‘individual screens’. Then I changed player 2’s humanoidwalk speed and I got the same result, everything worked as intended (If we’re both looking at the same desire).