Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make the Player punch?

Asked by 5 years ago

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!

0
This isn't a request site. FixRobloxz 61 — 5y

1 answer

Log in to vote
0
Answered by
Despayr 505 Moderation Voter
5 years ago
Edited 5 years ago

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)]

0
I would use ContextActionService Sonnenroboter 336 — 5y
Ad

Answer this question