Script changes walkspeed only half the time

Ive been working on a pizza tower fangame in roblox studio and this script for going into the tutorial gate only changes the walkspeed half the time. Its really annoying and I need help for fixing it. Heres the script, located in the fade gui:

local fade = script.Parent
local TweenService = game:GetService("TweenService")
wait(8)
local tutorialgate = game.Workspace.TutorialGate.Portal
local humanoidRootPart = game.Players.LocalPlayer.Character:FindFirstChild("HumanoidRootPart")
local tutorialpos = Vector3.new(-11, 46.546, 62.799) -- Example coordinates
tutorialgate.Touched:Connect(function(hit)
		game.Players.LocalPlayer.Character:FindFirstChildWhichIsA("Humanoid").WalkSpeed = 0
		game.Players.LocalPlayer.Character:FindFirstChildWhichIsA("Humanoid").JumpPower = 0
		TweenService:Create(
			fade,
			TweenInfo.new(0.5), -- Amount of seconds
			{BackgroundTransparency = 0} -- Goal

		):Play() -- Plays your tween
		task.wait(0.5)
	game.Players.LocalPlayer.Character:FindFirstChildWhichIsA("Humanoid").WalkSpeed = 20
	game.Players.LocalPlayer.Character:FindFirstChildWhichIsA("Humanoid").JumpPower = 80
	game.Workspace.HubMusic:Stop()
	game.Workspace.TutorialMusic:Play()
		humanoidRootPart.CFrame = CFrame.new(tutorialpos)
		TweenService:Create(
			fade,
			TweenInfo.new(0.5), -- Amount of seconds
			{BackgroundTransparency = 1} -- Goal

		):Play() -- Plays your tween
end)

Thanks!

maybe try putting a debounce on it, the problem might be that the touched event is firing multiple times for a player

yeah all touched events should have a debounce or some sort, I suspect this is highly the case here