Run script not working after character death

Trying to make a run script, but it couldn’t be a normal local script run script due to me needing to change the running/walking values. The script works fine but after the humanoid dies the scripts stop working.

Here is the local script:

local UIS = game:GetService("UserInputService")
local p = game.Players.LocalPlayer
local RS = script.Parent:WaitForChild("RunServer")
local CWV = RS:WaitForChild("CurrentWalkValue")
local CRV = RS:WaitForChild("CurrentRunValue")
UIS.InputBegan:Connect(function(key, IsTyping)
	if IsTyping then return end
	if key.KeyCode == Enum.KeyCode.LeftControl then
		script.Parent.RunServer.Run:FireServer()
	end	
	
	
end)
CRV.Changed:Connect(function()
	
	script.Parent.RunServer.CH:FireServer()
	
end)
CWV.Changed:Connect(function()

	script.Parent.RunServer.CH:FireServer()

end)

The server script:

local c = script.Parent 
local IsRunning = script:WaitForChild("IsRunning")
local CWV = script:WaitForChild("CurrentWalkValue")
local CRV = script:WaitForChild("CurrentRunValue")
local RE = script:WaitForChild("Run")
local GE = c:WaitForChild("GunEquipped")
local CH = script:WaitForChild("CH")
local DefaultCRV = 30
local DefaultCWV = 16
RE.OnServerEvent:Connect(function()
	if IsRunning.Value == false then
		if GE.IsAiming.Value ~= true then
			c.Humanoid.WalkSpeed = CRV.Value
			IsRunning.Value = true
		end	
	elseif IsRunning.Value == true then
		c.Humanoid.WalkSpeed = CWV.Value
		IsRunning.Value = false
	end
	
	
end)
IsRunning.Changed:Connect(function()
	if IsRunning.Value == false then
		c.Humanoid.WalkSpeed = CWV.Value
	elseif IsRunning.Value == true then
		c.Humanoid.WalkSpeed = CRV.Value
	end
end)

GE.Changed:Connect(function()
	
	if GE.Value == false then
		CRV.Value = DefaultCRV
		CWV.Value = DefaultCWV
	end
	
end)
CH.OnServerEvent:Connect(function()
	
	if IsRunning.Value == false then
		c.Humanoid.WalkSpeed = CWV.Value
	elseif IsRunning.Value == true then
		c.Humanoid.WalkSpeed = CRV.Value
	end
end)

Both are in starter character scripts
image

image

(If it helps, CurrentRunValue and CurrentWalkValue are ints, IsRunning is a bool.)

have u tried putting it in StarterGui as this will rerun on respawn character. Just an Idea

Doesn’t StarterPlayerScripts not support server scripts (I tested it still just to be sure)? Also, after death, the scripts are still there along with the child values, they just don’t really work.

but it couldn’t be a normal local script run script due to me needing to change the running/walking values

Local scripts are able to change the player speed and jump power! You can try to put it back into a local script and it may fix it!

idk, try using ChildAdded to call da script to run everytime plr load?