in case you cant copy here is raw paste https://pastebin.com/raw/6jC7hnzn Edited
local tool = script.Parent local Players = game:GetService("Players") local player = Players.LocalPlayer local character = player.Character while character.Parent == nil do character.AncestryChanged:Wait() end local leaderstats = player.leaderstats local cooldown = 2 local ready = true local humanoid = character:WaitForChild("Humanoid") local animation = tool.Animation local animationTrack = humanoid:LoadAnimation(animation) tool.Activated:Connect(function() if ready == true then animationTrack:Play() --animationTrack.Looped = true print("Animation Played!") leaderstats.Strength.Value = leaderstats.Strength.Value + 1 print("Strength Added!") ready = false animationTrack:Stop() wait(cooldown) print("Cooldown Done!") ready = true end end)
attempt to index nil with 'Parent
[Edit by JesseSong:] Tip use a codeblock when answering questions, as it makes it easier and legible for us to read.
Closed as Non-Descriptive by JesseSong
This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.
Why was this question closed?