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)

2 comments
Your code is perfectly fine, just ther was no player matching the Owner's value.
No, I found the answer, It's because i put the ".Value' in line 1 what i needed to do what put it in line 2 like :FindFirstChild(O.Value)