I need help with UserInputService

I was trying to add attack if a person pressed a button but it doesn’t work can anyone tell me why?

uis.InputBegan:Connect(function(input, gameProcessedEvent)
	if db then
		db = false
		if input.KeyCode == Enum.KeyCode.E then
			Hitbox:Hitstart(2)
			char.WalkSpeed = 0
			char.JumpHeight = 0
			if Spin then
				Spin:Play()
				wait(2)
				char.WalkSpeed = 16
				char.JumpHeight = 7.2
			end
		end
		wait(8)
		db = true
	end
end)

What is your error? also is char the Character or a Humanoid

1- Use task.wait() instead of wait.
2- Jump and WalkSpeed are Humanoid’s Properties, not the player’s character

3-Could you provide the error itself + variables you use here?

char is tool.parent and the problem is if I change uis.InputBegan to Tool.Activated and remove input stuff the attack works normally (sorry for the bad explanation)

Output nor Script Analysis is not Showing me errors
https://gyazo.com/9805becab15a83ed12b4b887e8a15fe8 (variables?)

Keep in mind that when a tool is unequipped, its parent becomes Backpack and not the character

I can show you the whole script if you want