DataStore doesn't seem to save my leaderboard?
Asked by
5 years ago Edited 5 years ago
01 | local DataStoreService = game:GetService( "DataStoreService" ) |
02 | local T 1 = DataStoreService:GetDataStore( "SavePoints" ) |
04 | game.Players.PlayerAdded:Connect( function (Player) |
05 | local leaderstats = Instance.new( "Folder" ) |
06 | leaderstats.Name = "leaderstats" |
07 | leaderstats.Parent = Player |
08 | local Point = Instance.new( "IntValue" ) |
10 | Point.Parent = leaderstats |
13 | game.Players.PlayerRemoving:Connect( function (player) |
15 | T 1 :SetAsync(player.UserId.. "-Points" ,player.leaderstats [ "Points" ] .Value) |
Is anything wrongs with it? because each times i leave and join again it'll reset my points back to 0 ! and not even a single saves in it?
btw i already enable Studio Access to API Services