20:13:25.447 - Workspace.Tycoon1.CashModule.Button.ClickDetector.CashCollect:5: attempt to index nil with 'Value'
local cash = game.Workspace.Tycoon1.CashModule.Screen.Cash.Value local button = script.Parent button.MouseClick:Connect(function(plr) plr:WaitForChild('Cash', 2).Value = cash cash.Value = 0 end)
Heya, so you already defined .Value in the variable and you are defining it again in the MouseClick event. So just change that up and it should get rid of the error.
local cash = game.Workspace.Tycoon1.CashModule.Screen.Cash local button = script.Parent button.MouseClick:Connect(function(plr) plr:WaitForChild('Cash', 2).Value = cash.Value cash.Value = 0 end)