This script was brought up in another question, but it was a while a go and was not given a working answer. Please go over my script and help me figure out what is wrong with it.
local owner = script.Parent.Parent.Parent.Owner
local db = false
script.Parent.Touched:connect(function(hit)
if db == false then
db = true
if hit.Parent.leaderstats.Money.Value >= 200 and hit.Parent.Name == owner.Value then
-----------------------------
hit.Parent.leaderstats.Money.Value = hit.Parent.leaderstats.Money.Value - 200
-----------------------------
script.Parent.Parent.Parent.WallUpgrade2.Wall1.Transparency = 0
script.Parent.Parent.Parent.WallUpgrade2.Wall1.CanCollide = true
script.Parent.Parent.Parent.WallUpgrade2.Wall2.Transparency = 0
script.Parent.Parent.Parent.WallUpgrade2.Wall2.CanCollide = true
script.Parent.Parent.Parent.WallUpgrade2.Wall3.Transparency = 0
script.Parent.Parent.Parent.WallUpgrade2.Wall3.CanCollide = true
script.Parent.Parent.Parent.WallUpgrade2.Wall4.Transparency = 0
script.Parent.Parent.Parent.WallUpgrade2.Wall4.CanCollide = true
-----------------------------
script.Parent.Transparency = 1
script.Parent.CanCollide = false
script.Parent.Parent.BuyWallsLabel.SurfaceGui.TextLabel.TextTransparency = 1
script.Disabled = true
-----------------------------
end
db = false
end
end)
Thank you in advance for your help.
BTW: There is an error in line 7. ;)

4 comments
Well, first of all, if it's a leaderboard you're trying to access, it's not going to be in hit.Parent. It'll be in the player, not the player's character.
How do I find the player, not the char?
I already answered this. And fixed all the errors.
It didn't work.