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)
Try replacing it with this:
if plr.Name==script.Parent.Parent.Parent.OwnerName.Value and (plr.leaderstats.Money.Value>=price) then
Parentheses indicates you're comparing it to a number.
You did not define plr. Try using something like this.
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 plr = game.Players:GetChildren() 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)
As you used to define product and price.