What is wrong with this script I want to make this Shop Gui work!
player = script.Parent.Parent.Parent.Parent.Parent
Points = player.leaderstats.Cash
upgradeStuff = game.Lighting.GravityCoil
function buy()
if Points.Value >= 250 then
Points.Value = Points.Value - 250
upgradeStuff:clone().Parent = player.Backpack
wait(2)
else
script.Parent.Parent.Text = "You cant afford this!"
wait(3)
script.Parent.Parent.Text = "Gravity Coil"
end
end
script.Parent.MouseButton1Down:connect(buy)
Plz help with instructions on what each line does

1 comment
plz vote my post up so i can get my reputaion up cuz right now i cant vote for others