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

Trying to set values with a database can anyone help?

Can anyone tell me what I did rouge in this?

local DataStoreService = game:GetService('DataStoreService')
local Con = script.Parent.Con
local Storage = Con.Storage
local Prim = Con.Prim
local Sec = Con.Sec
local Key = game.Players.LocalPlayer.userId
-- Slots
local DSS1 = DataStoreService:GetDataStore('Slot1')
local DSS2 = DataStoreService:GetDataStore('Slot2')
local DSS3 = DataStoreService:GetDataStore('Slot3')
local DSS4 = DataStoreService:GetDataStore('Slot4')
-- Prim
local Primm = DataStoreService:GetDataStore('Prim')
-- Sec
local Secc = DataStoreService:GetDataStore('Sec')
-- Function
game.Players.PlayerAdded:connect(function()
	Storage.Slot1.Value = DSS1:GetAsync(Key)
end)

game.Players.PlayerRemoving:connect(function()
	DSS1:SetAsync(Key, Storage.Slot1.Value)
end)

3 comments

0

What's the issue?

0

It wont save the data when the player leaves

0

or getting the data

1 answer

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