Hey, i was following a video tutorial from peas factory about key pressed event. I followed everything he did in that video and i wanted to test myself by trying something new. I wanted my character to jump when a key was pressed but i don't really know how to do it. I also looked up the roblox wiki page and i found out that Humanoid.Jump is a bool value, so if i want my character to jump i must set it to true. I was wondering if someone could help me with my script.
player = game.Players.LocalPlayer
tool = script.Parent
handle = tool.Handle
tool.Equipped:Connect(function(mouse)
mouse.KeyDown:connect(function(key)
if key == "f" then
player.Character.Humanoid.Jump = true
end
end)
end)
Also i inserted a tool in the starter pack,a part called "Handle" in the tool and the script i used was a local script so there are no tehnical issues to call them this way.
Thanks in advance for helping me!

5 comments
Did you test the script? If it didn't work, were there any errors?
there were no errors and yes i tested it
KeyDown is deprecated, use User input service: https://developer.roblox.com/en-us/api-reference/class/UserInputService Message me if you need help
Also, im writing a script for you.
thanks in advance