script.Parent.Catch.Touched:connect(function(otherPart)
print(otherPart)
local plr = script.Parent.Parent.Parent.OwnerName.Value
local turninprice = otherPart.Parent.turninprice.Value
if otherPart.Parent.Parent == script.Parent.Parent.Parent.MoneyBricks then
otherPart:Destroy()
print ("Part deleted")
print (plr)
game.Players.plr.leaderstats.Money.Value=plr.leaderstats.Money.Value+turninprice
end
end)
08:31:27.072 - plr is not a valid member of Players 08:31:27.072 - Script 'Workspace.Tycoon.ConveyorLine1.Catcher.Catcher', Line 9
This is the error I receive when the script is trying to work, I've established the variable as plr, and even when it prints "plr" it prints Player1, however when I try to call the variable on line 9, it doesn't establish that game.Players.plr is supposed to mean game.Players.player1 (or whoever's name is on the OwnerName value)
Any help would be appreciated, thanks!

1 comment
If I modify my script with what you said, I receive the error, "09:57:59.343 - Player is not a valid member of DataModel" and the leaderstats are not added