game.Players.PlayerAdded:connect(function(player)
local PlayerStorege = player:WaitForChild("PlayerStorege")
local RemoteSAVE = PlayerStorege:WaitForChild("RemoteSAVE")
local RemoteLOAD = PlayerStorege:WaitForChild("RemoteLOAD")
local Cash = player.PlayerStats:WaitForChild("Cash")
wait(5)
Cash.Value = PlayerCashDataStore:GetAsync(player.UserId) or 0
if PlayerCashDataStore:GetAsync(player.UserId) == 0 then
Cash.Value = 100
PlayerCashDataStore:SetAsync(player.UserId, Cash.Value)
else
end
ERROR Unable to cast value to function

1 comment
If you posted the full code that would help alot, and the error explains itself