Output is 23:32:29.768 - Workspace.IronPrinter.Printer.Main.Collect.Collect:3: attempt to index local 'onButtonClicked' (a nil value)
Its inside a surface gui and i dont know what i did wrong
script.Parent.MouseButton1Click:connect(function(onButtonClicked) script.Parent.Sound:Play() local player = game.Players:GetPlayerFromCharacter(onButtonClicked.Parent) local leaderstats = player:WaitForChild("leaderstats") leaderstats.Money.Value = script.Parent.Parent.Parent.Cash.Value + leaderstats.Money.Value script.Parent.Parent.Parent.Cash.Value = 0 end)