01 | game.Players.PlayerAdded:connect( function (player) |
02 | local PlayerStorege = player:WaitForChild( "PlayerStorege" ) |
03 | local RemoteSAVE = PlayerStorege:WaitForChild( "RemoteSAVE" ) |
04 | local RemoteLOAD = PlayerStorege:WaitForChild( "RemoteLOAD" ) |
05 | local Cash = player.PlayerStats:WaitForChild( "Cash" ) |
06 |
07 | wait( 5 ) |
08 | Cash.Value = PlayerCashDataStore:GetAsync(player.UserId) or 0 |
09 | if PlayerCashDataStore:GetAsync(player.UserId) = = 0 then |
10 | Cash.Value = 100 |
11 | PlayerCashDataStore:SetAsync(player.UserId, Cash.Value) |
12 | else |
13 | end |
ERROR Unable to cast value to function
01 | local DataStore = game:GetService( "DataStoreService" ) |
02 | local PlayerCashDataStore = DataStore:GetDataStore( "PlayerCashDataStoreeee" ) |
03 |
04 |
05 |
06 | game.Players.PlayerAdded:connect( function (player) |
07 | local PlayerStorege = player:WaitForChild( "PlayerStorege" ) |
08 | local RemoteSAVE = PlayerStorege:WaitForChild( "RemoteSAVE" ) |
09 | local RemoteLOAD = PlayerStorege:WaitForChild( "RemoteLOAD" ) |
10 | local Cash = player.PlayerStats:WaitForChild( "Cash" ) |
11 |
12 | wait( 5 ) |
13 | Cash.Value = PlayerCashDataStore:GetAsync(player.UserId) or 0 |
14 | if PlayerCashDataStore:GetAsync(player.UserId) = = 0 then |
15 | Cash.Value = 100 |