Here is my script. Output says there is something wrong with line 15. It is a tycoon script inside one of those buttons you purchase items with.
repeat wait() until script.Parent.Product.Value~=nil
local product=script.Parent.Product.Value:clone()
script.Parent.Product.Value:remove()
local price=script.Parent.Price.Value
script.Parent.Name=script.Parent.ProductName.Value.."-"..price
if price==0 then
script.Parent.Name=script.Parent.ProductName.Value.." - Free"
end
script.Parent.Head.Touched:connect(function(hit)
chr=hit.Parent
if chr:findFirstChild("Humanoid") and game.Players:GetPlayerFromCharacter(chr) then
if plr.Name==script.Parent.Parent.Parent.OwnerName.Value and plr.leaderstats.Money.Value>=price then
plr.leaderstats.Money.Value=plr.leaderstats.Money.Value-price
product.Parent=script.Parent.Parent.Parent
script.Parent:remove()
end
end
end)

2 comments
What exactly does it say is wrong on line 15?
Workspace.Tycoon.Purchasing.Product - Price.Script:15: attempt to index global 'plr' (a nil value)