So when I tried finding the leaderstats so I could earn some points for my stats, this error appeared: "Players:vxcaie.Backpack.Energy.Script:1: attempting to index nil with 'leaderstats"
Note: It says "vxcaie" because i actually changed my username recently so it doesn't say vxcaie in this website.
Script:
energyamt = game.Players.LocalPlayer.leaderstats.Power db = true script.Parent.Activated:Connect(function() if db == false then db = true energyamt.Value = energyamt.Value + 1 db = false wait(2) end end)
local tool,debounce=script.Parent,nil local power=tool.Equipped:Wait()and game.Players[tool.Parent.Name].leaderstats.Power tool.Activated:Connect(function() if debounce then return end debounce=true power.Value+=1 wait(2) debounce=false end)