Title explains everything. Here's my code.
local datastore = game:GetService("DataStoreService"):GetDataStore("justatestkeyforforumnotactualcode")
game.Players.PlayerAdded:connect(function(plr)
local key = "ID-"..plr.UserId
local getSaved = datastore:GetAsync(key)
local keydata1 = Instance.new("BoolValue", plr)
local keydata2 = Instance.new("StringValue", plr)
keydata1.Name = "WindforceBoughtSave"
keydata2.Name = "EquippedSwordSave"
if getSaved then
keydata1.Value = getSaved -- This is where I'm confused. This is the bool value.
keydata2.Value = plr.PlayerGui.EquippedSword.Value -- This is also where I'm confused. This is the string value.
else
local saved1 = {keydata1.Value}
local saved2 = {keydata2.Value}
datastore:SetAsync(key, saved1, saved2)
end
end)
game.Players.PlayerRemoving:connect(function(plr)
local key = "ID-"..plr.UserId
local savetable1 = {plr.PlayerGui.EquippedSword.Value}
local savetable2 = {plr.PlayerGui.WindforceBought.Value}
datastore:SetAsync(key, savetable1, savetable2)
end)
So, how would I do this? I'm extremely confused at this situation. I've also read the API:Class/HttpService/GetAsync thing too.
