Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Data Stores don't seem to be working?

Asked by 5 years ago

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.

01local DSService = game:GetService("DataStoreService"):GetDataStore("KytesSave")
02local PlayersLeft = 0
03 
04game.Players.PlayerAdded:Connect(function(player)
05    PlayersLeft = PlayersLeft + 1
06    local Kytes = Instance.new("IntValue")
07    Kytes.Name = "Kytes"
08    Kytes.Value = 0
09    Kytes.Parent = player
10    local player_data
11pcall (function()
12    player_data = DSService:GetAsync(player.UserId.."-Kytes")
13end)
14 
15if player_data ~= nil then
View all 37 lines...
0
What is it your trying to save? I don't understand.... Please explain what you are trying to do voidofdeathfire 148 — 5y
0
I'm trying to save the "Kytes" value, the currency of the game. itchymoonfire 179 — 5y
0
On line #26 {player.Kytes.Value}, On Line #16 {player_data[1]} User#26586 0 — 5y
0
Pretty sure Datastore only accepts tables and not values User#26586 0 — 5y

Answer this question