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

i am trying to make a two attack animations that a random but it wont work how do i fix?

Asked by 6 years ago
01local plr = game.Players.LocalPlayer
02local attack = false
03    local mouse = plr:GetMouse()
04    local char = plr.Character
05script.Parent.Activated:Connect(function()
06 
07    local hum = char.Humanoid:LoadAnimation(script.Parent.Animation or script.Parent.Animationsd)
08    script.Parent.Blade.Trail.Enabled = true
09    hum:Play()
10    attack = true
11    wait(.50)
12    hum:Stop()
13    script.Parent.Blade.Trail.Enabled = false
14 
15    script.Parent.Blade.Touched:Connect(function(hit)
View all 23 lines...
0
Do you have an idea as to why it may not work? User#19524 175 — 6y
0
nope helleric -3 — 6y
0
Maybe ugly and unindented code is no longer working? lunatic5 409 — 6y

1 answer

Log in to vote
1
Answered by
Epuuc 74
6 years ago
01local plr = game.Players.LocalPlayer
02local attack = false
03local mouse = plr:GetMouse()
04local char = plr.Character
05script.Parent.Activated:Connect(function()
06    local animations = {"Animation","Animationsd"}
07    local hum = char.Humanoid:LoadAnimation(script.Parent[animations[math.random(1,#animations)]])
08    script.Parent.Blade.Trail.Enabled = true
09    hum:Play()
10    attack = true
11    wait(.50)
12    hum:Stop()
13    script.Parent.Blade.Trail.Enabled = false
14    script.Parent.Blade.Touched:Connect(function(hit)
15        local hum =  hit.Parent:FindFirstChild("Humanoid")
View all 21 lines...
0
view the source, for some reason some of line 7 is cut off Epuuc 74 — 6y
Ad

Answer this question