So like when the player presses F it does a punch (which I have already, using userinputservice) but um how do I make it so if the player touches the NPC when they click F, it does damage
local UserInputService = game:GetService("UserInputService")
local Humanoid = game.Workspace.TestingNPCForWalking.Humanoid
UserInputService.InputBegan:Connect(function(input,gameProccesedEvent)
if input.KeyCode == Enum.KeyCode.F then
print("Test")
end
end)
So in the print(“Test”) area it should like do damage to the NPC if it’s hit