Walkspeed not changing when i type in walkspeed

when i reset the walkspeed changes butt… when i wanna change the walkspeed it doesnt do noTHING

THE SCRIPT:
local player = game.Players.LocalPlayer

local char = player.Character or player.CharacterAdded:Wait()

local h = char.Humanoid
TexasButton.MouseButton1Click:Connect(function()

if tonumber(TextBox.Text)<100 then
	h.WalkSpeed = tonumber(TextBox.Text)
else
	h.WalkSpeed = 16


end 

end)

local myspeedbeforedeath
player.Character:WaitForChild(“Humanoid”).Died:Connect(function()

myspeedbeforedeath = player.Character.Humanoid.WalkSpeed

end)

player.CharacterAdded:Connect(function()

player.Character:WaitForChild("Humanoid").WalkSpeed = myspeedbeforedeath

end)

function onKeyPress(inputObject, gameProcessedEvent)
if inputObject.KeyCode == Enum.KeyCode.RightControl then
if Frame.Visible == false then
Frame.Visible = true
else
Frame.Visible = false
end
end
end

game:GetService(“UserInputService”).InputBegan:connect(onKeyPress)

If statements only run if the following parameter is true, meaning you don’t usually have to add an “else” unless you need to disconnect a function or something along the lines of that.

In addition, you should be using a :WaitForChild() on the humanoid.

soo dont say h.WalkSpeed = 16?

Correct, because that’s the default walk speed. Anything larger than 100 won’t work and will return the if statement false.