local main = script.Parent local walkbtn = main.EnterTextBtn local jumpbtn = main.EnterTextBtn2 local player = game.Players.LocalPlayer local Character = player.Character or player.CharacterAdded:Wait() local humanoid = Character:WaitForChild("Humanoid") local amount = main.Amount walkbtn.MouseButton1Down:connect(function() humanoid.WalkSpeed = amount.Text end) jumpbtn.MouseButton1Down:connect(function() humanoid.JumpPower = amount.Text end)
I can't say for sure because PlayerGui should be reset on death anyways but I am assuming that it is erroring because you are declaring the humanoid variable one time. After the player dies, their character is deleted and respawned which means that the humanoid value is now nil
local main = script.Parent local walkbtn = main.EnterTextBtn local jumpbtn = main.EnterTextBtn2 local player = game.Players.LocalPlayer local amount = main.Amount walkbtn.MouseButton1Down:connect(function() if player.Character and player.Character:FindFirstChildOfClass("Humanoid") then player.Character:FindFirstChildOfClass("Humanoid").WalkSpeed = tonumber(amount.Text) end end) jumpbtn.MouseButton1Down:connect(function() if player.Character and player.Character:FindFirstChildOfClass("Humanoid") then player.Character:FindFirstChildOfClass("Humanoid").JumpPower = tonumber(amount.Text) end end)