game.Players.PlayerAdded:Connect(function(player) local leaderstats = Instance.new('Model') leaderstats.Name = 'leaderstats' leaderstats.Parent = player local JumpPower = Instance.new('IntValue') local char = player.Character or player.CharacterAdded:Wait() local hum = char.Humanoid JumpPower.Value= 0 + hum.JumpPower JumpPower.Parent=leaderstats JumpPower.Name='Score' end)
How can I make this script update JumpPower.Value without a while true loop?
Use humanoid.Changed:Connect(function() ... end)
you can see more here: Roblox Wiki - Changed
Here is a example:
workspace.Baseplate.Changed:Connect(function() print("Baseplate changed!") end)
Here is your fixed script:
game.Players.PlayerAdded:Connect(function(player) local leaderstats = Instance.new('Model') leaderstats.Name = 'leaderstats' leaderstats.Parent = player local JumpPower = Instance.new('IntValue') local char = player.Character or player.CharacterAdded:Wait() local hum = char.Humanoid JumpPower.Value= hum.JumpPower JumpPower.Parent=leaderstats JumpPower.Name='Score' hum.Changed:Connect(function() JumpPower.Value = hum.JumpPower end) end)
Hope it helped :D
Errors? tell-me on comments.