I have gotten better at scripting but i am still getting errors and this is one of them i do npt understand and cant solve.
I am trying to make a shop gui that upgrades your weapon but it doesn't seem to detect the leaderstats. I cant understand what the error means.
Heres the script
script.Parent.MouseButton1Click:Connect(function()
local human = workspace:FindFirstChild("Humanoid")
print("Humanoid Found!")
local plr = script.Parent.Parent.Parent.Parent
print("Player Found!")
if plr.leaderstats.Points.Value >= 24000 then
print("checked")
plr.leaderstats.Points.Value = plr.leaderstats.Points.Value - 24000
script.Parent.Parent.Parent.old:Play()
wait(1)
script.Parent.Parent.Parent.olqa:Play()
wait(6)
script.Parent.Parent.Parent.olqa:Stop()
script.Parent.Parent.Parent.buy:Play()
game.ReplicatedStorage["PAP. Ray Gun"]:Clone().Parent = plr.Backpack
else
script.Parent.Text = "Inefficient Funds"
wait(2)
script.Parent.Text = "BUY"
end
end)
note: the script is a local script note2: the line thats specifically causing the problems is this
if plr.leaderstats.Points.Value >= 24000 then
I just need a way to fix this error so that the script can work correctly

1 comment
Thanks this worked! All i needed to do was add another Parent? Wow now i feel dumb lol