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

Data store error help

Asked by
1N0body 206 Moderation Voter
10 years ago

I was doing some research and stuff with the Data store, until this error came in my way:

Player3STORE 22:17:15.505 - Place has to be opened with Edit button to access DataStores 22:17:15.506 - Workspace.Script:5: attempt to index global 'ds' (a nil value) 22:17:15.506 - Script 'Workspace.Script', Line 5 22:17:15.506 - stack end 22:17:15.506 - Disconnected event because of exception

Ok, I opened up with that special "Edit" button from the 'Devoleper' tab and started the server, started player, still got this error. I don't know what I need to do to acces the Data Store. In online mode I can't see the prints or the error what it gives me. Here's the code what I've used:

game.Players.PlayerAdded:connect(function (plr)
pl = tostring(plr.Name..'STORE') -- Using global data store so every player has it's own
print(pl) -- Just to check
ds = game:GetService("DataStoreService"):GetDataStore(pl) -- Get the data
j = ds:GetAsync('Weapons') -- Let's see if it has something
print (j) -- Print it out
end)

Code works, but I don't have acces to Data Store in the Studio mode.

0
To test DataStore, you should go online on the place itself if Start server & Player doesn't work. RaverKiller 668 — 10y

1 answer

Log in to vote
0
Answered by
Vrakos 109
10 years ago

If your script doesn't work in online mode, use a remote error debugger. ROBLOX has made one and it is really helpful as it tells you errors in game.

0
It's harder to do it, the script is loaded faster that that GUI so I can't really check the errors but thanks anyways 1N0body 206 — 10y
Ad

Answer this question