local O = script.Parent.Owner.Value local P = game.Players:FindFirstChild(O) while true do if P.leaderstats then P.leaderstats.Cash.Value = script.Parent.Owner.Money.Value end wait() end
Error code in output: Workspace.Tycoon.CashHandlerScript:6: attempt to index local 'P' (a nil value)
As Goulstem already stated, there is nothing wrong with the script at all. Make sure your other scripts are correct, and that the value is there in the first place.
I'd suggest adding in this before defining the variable:
repeat wait() until script.Parent.Owner.Value
That'd help make sure that there is a value in there before the script tries going through the rest of your code.
Anyways, hope I helped a bit, and if you have any questions or problems, please leave a comment below :P