Data Stores don't seem to be working?
So I'm having troubles with data stores despite the print debugging method working fully through. There seem to be no errors in output either. The script is in a folder in ServerScriptService.
01 | local DSService = game:GetService( "DataStoreService" ):GetDataStore( "KytesSave" ) |
04 | game.Players.PlayerAdded:Connect( function (player) |
05 | PlayersLeft = PlayersLeft + 1 |
06 | local Kytes = Instance.new( "IntValue" ) |
12 | player_data = DSService:GetAsync(player.UserId.. "-Kytes" ) |
15 | if player_data ~ = nil then |
16 | Kytes.Value = player_data |
22 | local bindableEvent = Instance.new( 'BindableEvent' ) |
24 | game.Players.PlayerRemoving:Connect( function (player) |
26 | DSService:SetAsync(player.UserId.. '-Kytes' , player.Kytes.Value) |
28 | PlayersLeft = PlayersLeft - 1 |
33 | game:BindToClose( function () |
34 | while PlayersLeft > 0 do |
35 | bindableEvent.Event:Wait() |