Can anyone figure this out?
01 | script.Parent:WaitForChild( "Handle" ); |
09 | debris = game:GetService( "Debris" ), |
11 | script.Parent:WaitForChild( "Slash2Anim" ), |
12 | script.Parent:WaitForChild( "Slash3Anim" ), |
13 | script.Parent:WaitForChild( "Slash4Anim" ), |
16 | script.Parent.Handle:WaitForChild( "Slash1" ) |
23 | script.Parent.Handle.Touched:connect( function (hit) |
24 | if hit.Parent~ = game.Players.LocalPlayer.Character and hit.Name~ = "Handle" and hit.Name~ = "Effect" and gearConfig.isSwinging and gearConfig.attackDeb then |
25 | local h = hit.Parent:FindFirstChild( "Humanoid" ); |
26 | local t = hit.Parent:FindFirstChild( "Torso" ); |
27 | if h~ = nil and t~ = nil and h.Health> 0 then |
28 | gearConfig.attackDeb = false ; |
29 | for i,v in ipairs (h:GetChildren()) do |
30 | if v.Name = = "creator" then |
34 | local c = Instance.new( "ObjectValue" , h); |
36 | c.Value = game.Players.LocalPlayer; |
37 | h:TakeDamage(gearConfig.damage); |
39 | gearConfig.attackDeb = true ; |
44 | gearConfig.gear.Unequipped:connect( function () |
45 | gearConfig.equipped = false ; |
48 | gearConfig.gear.Equipped:connect( function (m) |
49 | gearConfig.equipped = true ; |
51 | local human = script.Parent.Parent:findFirstChild( "Humanoid" ); |
52 | for i = 1 , #gearConfig.anims do |
53 | table.insert(gearConfig.readyAnims, human:LoadAnimation(gearConfig.anims [ i ] )); |
56 | m.Button 1 Down:connect( function () |
57 | if (gearConfig.check and human.Health > 0 ) then |
58 | gearConfig.check = false ; |
59 | local a = math.random( 1 , #gearConfig.readyAnims); |
60 | gearConfig.readyAnims [ a ] :Play(); |
61 | gearConfig.sounds [ math.random( 1 , #gearConfig.sounds) ] :Play(); |
62 | gearConfig.isSwinging = true ; |
63 | Spawn( function () wait(gearConfig.deb); gearConfig.check = true ; end ); |
64 | repeat gearConfig.trail(); wait( 0.085 ) until gearConfig.check or not gearConfig.equipped |
65 | gearConfig.isSwinging = false ; |
69 | m.Button 1 Up:connect( function () |
70 | if (gearConfig.check and human.Health > 0 ) then |
Error:
Players.Player.Backpack.Fire Tribe.LocalScript:67: attempt to call field 'trail' (a nil value)