How do i random animation punch?
How do i make punch random animation?
Here the code
01 | local player = game.Players.LocalPlayer |
06 | local anim = Instance.new( "Animation" ) |
09 | game.Players.LocalPlayer.Character:WaitForChild( "RightHand" ).Touched:Connect( function (hit) |
10 | if hit.Parent:FindFirstChild( "Humanoid" ) and db 2 and hit.Parent.Humanoid ~ = game.Players.LocalPlayer.Character.Humanoid then |
11 | if game.Players.LocalPlayer.Character.Humanoid.Health > 0 then |
12 | game.ReplicatedStorage.Punch:FireServer(hit.Parent.Humanoid) |
17 | game:GetService( "UserInputService" ).InputBegan:Connect( function (input, event) |
18 | if input.UserInputType = = Enum.UserInputType.MouseButton 1 then |
23 | local playAnim = game.Players.LocalPlayer.Character:WaitForChild( "Humanoid" ):loadAnimation(anim) |