Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Can somebody explain DataStore a little better?

I don't quite understand it

local DataStore = game:GetService("DataStoreService"):GetDataStore("Weapon1")
 
game.Players.PlayerAdded:connect(function(player)
	local key = "Weapon1" .. player.userId
	DataStore:GetAsync(key, function(oldValue)
		if oldValue == new then
			--code to give weaoon
		else
		print("weapon not owned")
	end)
end)

Would that work to check if somebody owned a weapon before?

2 comments

0

You need to save the weapon to data store.

0

I know that, but if I had it saved, would that work to check it?

1 answer

I Love this script and how you made it, Yes. It does work, the problem is... You need to save the weapon to the data store

This discussion is preserved as it was. New answers, comments, and votes are closed.