What Keycode For Left Click here script for punch :
01 | local player = game.Players.LocalPlayer |
02 | local db = true |
03 | local damage = false |
04 |
05 | local anim = Instance.new( "Animation" ) |
06 | anim.AnimationId = "http://www.roblox.com/asset?id=3582012915" |
07 |
08 | game.Players.LocalPlayer.Character:WaitForChild( "RightHand" ).Touched:Connect( function (hit) |
09 | if hit.Parent:FindFirstChild( "Humanoid" ) and not db and not damage and hit.Parent.Humanoid ~ = game.Players.LocalPlayer.Character.Humanoid then |
10 | if game.Players.LocalPlayer.Character.Humanoid.Health > 0 then |
11 | damage = true |
12 | game.ReplicatedStorage.Punch:FireServer(hit.Parent.Humanoid) |
13 | end |
14 | end |
15 | end ) |
It's not a keycode you're looking for (because the mouse doesn't have keys), but a UserInputType:
if input.UserInputType == Enum.UserInputType.MouseButton1