How do I fix this? Animation and Tool the error I'm getting is attempt to index nil with 'Parent'
Please provide more explanation in your question. If you explain exactly what you are trying to accomplish, it will be much easier to answer your question correctly.
First I would like to say I apologize for what I done earlier, Second I have a error with my script, the error is attempt to index nil with 'Parent'
01 | local tool = script.Parent |
02 | local Players = game:GetService( "Players" ) |
03 | local player = Players.LocalPlayer |
04 | local character = player.Character |
05 | while character.Parent = = nil do |
06 | character.AncestryChanged:Wait() |
08 | local leaderstats = player.leaderstats |
11 | local humanoid = character:WaitForChild( "Humanoid" ) |
12 | local animation = tool.Animation |
13 | local animationTrack = humanoid:LoadAnimation(animation) |
16 | tool.Activated:Connect( function () |
21 | print ( "Animation Played!" ) |
22 | leaderstats.Strength.Value = leaderstats.Strength.Value + 1 |
23 | print ( "Strength Added!" ) |
27 | print ( "Cooldown Done!" ) |