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

How do i random animation punch?

Asked by 5 years ago

How do i make punch random animation?

Here the code

01local player = game.Players.LocalPlayer
02local db = true
03local db2 = false
04local damage = false
05 
06local anim = Instance.new("Animation")
08 
09game.Players.LocalPlayer.Character:WaitForChild("RightHand").Touched:Connect(function(hit)
10    if hit.Parent:FindFirstChild("Humanoid") and db2 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)
13        end
14    end
15end)
View all 31 lines...

1 answer

Log in to vote
0
Answered by
iuclds 720 Moderation Voter
5 years ago
01AnimationTable = {"123","1234"}
02 
03local player = game.Players.LocalPlayer
04local db = true
05 
06local db2 = false
07local damage = false
08 
09local anim = Instance.new("Animation")
10anim.AnimationId = "rbxassetid://"..(math.random(1, #AnimationTable))
11 
12game.Players.LocalPlayer.Character:WaitForChild("RightHand").Touched:Connect(function(hit)
13    if hit.Parent:FindFirstChild("Humanoid") and db2 and hit.Parent.Humanoid ~= game.Players.LocalPlayer.Character.Humanoid then
14        if game.Players.LocalPlayer.Character.Humanoid.Health > 0 then
15            game.ReplicatedStorage.Punch:FireServer(hit.Parent.Humanoid)
View all 34 lines...

i love you good sir

0
okay papa and thanks you papa OrewaKamidaa 40 — 5y
0
10 anim.AnimationId = "rbxassetid://"..(math.random(1, #AnimationTable)) OrewaKamidaa 40 — 5y
0
do i need to add both animation? and what is it code OrewaKamidaa 40 — 5y
Ad

Answer this question