Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make the Player punch?

Hello!

My Question is: How Is it possible to make the player Punch

the Idea is to set an Input using inputBegan such as "F", And once I click that

Input, The player should punch and if hes punch touches another Humanoid, It should damage it.

Thanks for Advance!

1 comment

0

This isn't a request site.

1 answer

I'm not going to provide a full script as you have not made an attempt, but you would use animations and a touched event.

Let's start you off with UserInputService, then you can check the developer Forum for more information.

You would use a local script to listen for the input, then a remote event to fire the request to the server

local UserInputService = game:GetService("UserInputService")


UserInputService.InputBegan:Connect(function(Input, Event)

     if Event then return end
     if Input.KeyCode == Enum KeyCode.F then

             --Your code here
     end
end)

Here are some links that you need to check out

[(http://developer.roblox.com/en-us/api-reference/event/BasePart/Touched)]

[(http://developer.roblox.com/en-us/articles/Remote-Functions-and-Events)]

1 comment

0

I would use ContextActionService

This discussion is preserved as it was. New answers, comments, and votes are closed.