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'
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)
I think you are referring to the lines 5-7. Character is a property of LocalPlayer - it has no Parent, so the lines 5-7 aren't needed. Also, give more information regarding your problem in future questions, please.