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

Trying to set values with a database can anyone help?

Asked by 7 years ago

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)
0
What's the issue? Uglypoe 557 — 7y
0
It wont save the data when the player leaves Credit_worthy -2 — 7y
0
or getting the data Credit_worthy -2 — 7y

1 answer

Log in to vote
2
Answered by 7 years ago

This video that I watched earlier really helped me out. You can change and meld the script into what you need: > https://www.youtube.com/watch?v=Nfm-CtRUNqk

Ad

Answer this question