I am making a shop for my game that uses a DataStore system to save values.
I have a list of the needed values below. (They don’t need to be a leader board, but they need to be values inside the local player)
[code]local info = Instance.new(“StringValue”)
info.Name = “PlayerInfo”
info.Parent = player
local Diamonds = Instance.new("NumberValue")
Diamonds.Name = "Diamonds"
Diamonds.Parent = info
Diamonds.Value = DataStore:GetAsync(player.userId.."Diamonds") or 0
local Credits = Instance.new("NumberValue")
Credits.Name = "Credits"
Credits.Parent = info
Credits.Value = DataStore:GetAsync(player.userId.."Credits") or 0
local Doge = Instance.new("StringValue")
Doge.Name = "Doge"
Doge.Parent = info
Doge.Value = DataStore:GetAsync(player.userId.."Doge") or "false"
local Valk = Instance.new("StringValue")
Valk.Name = "Valk"
Valk.Parent = info
Valk.Value = DataStore:GetAsync(player.userId.."Valk") or "false"
local Messor = Instance.new("StringValue")
Messor.Name = "Messor"
Messor.Parent = info
Messor.Value = DataStore:GetAsync(player.userId.."Messor") or "false"
local Vesp = Instance.new("StringValue")
Vesp.Name = "Vesp"
Vesp.Parent = info
Vesp.Value = DataStore:GetAsync(player.userId.."Vesp") or "false"
local RedSparkle = Instance.new("StringValue")
RedSparkle.Name = "RedSparkle"
RedSparkle.Parent = info
RedSparkle.Value = DataStore:GetAsync(player.userId.."RedSparkle") or "false"
local Sini = Instance.new("StringValue")
Sini.Name = "Sini"
Sini.Parent = info
Sini.Value = DataStore:GetAsync(player.userId.."Sini") or "false"
local wtop = Instance.new("StringValue")
wtop.Name = "wtop"
wtop.Parent = info
wtop.Value = DataStore:GetAsync(player.userId.."wtop") or "false"
local musica = Instance.new("StringValue")
musica.Name = "musica"
musica.Parent = info
musica.Value = DataStore:GetAsync(player.userId.."musica") or "false"
local reddom = Instance.new("StringValue")
reddom.Name = "reddom"
reddom.Parent = info
reddom.Value = DataStore:GetAsync(player.userId.."reddom") or "false"
local rduck = Instance.new("StringValue")
rduck.Name = "rduck"
rduck.Parent = info
rduck.Value = DataStore:GetAsync(player.userId.."rdcuk") or "false"
local sttf = Instance.new("StringValue")
sttf.Name = "sttf"
sttf.Parent = info
sttf.Value = DataStore:GetAsync(player.userId.."sttf") or "false"
local Wconj = Instance.new("StringValue")
Wconj.Name = "Wconj"
Wconj.Parent = info
Wconj.Value = DataStore:GetAsync(player.userId.."Wconj") or "false"
local Lconj = Instance.new("StringValue")
Lconj.Name = "Lconj"
Lconj.Parent = info
Lconj.Value = DataStore:GetAsync(player.userId.."Lconj") or "false"
local kettle = Instance.new("StringValue")
kettle.Name = "kettle"
kettle.Parent = info
kettle.Value = DataStore:GetAsync(player.userId.."kettle") or "false"
local tpot = Instance.new("StringValue")
tpot.Name = "tpot"
tpot.Parent = info
tpot.Value = DataStore:GetAsync(player.userId.."tpot") or "false"
local NextLogin = Instance.new("NumberValue")
NextLogin.Name = "NextLogin"
NextLogin.Value = DataStore:GetAsync(player.userId.."NextLogin") or 0
NextLogin.Parent = info
local Time = os.time()
if NextLogin.Value <= Time then
local NewGui = script.LoginGUI:Clone()
NewGui.Parent = player:WaitForChild("PlayerGui")
NewGui.GetDiamond.Disabled = false
NextLogin.Value = Time + (12*60*60)
DataStore:UpdateAsync(player.userId.."NextLogin" ,function() return NextLogin.Value end)
end
print('Success')
while true do
local Time = os.time()
if NextLogin.Value <= Time then
local NewGui = script.LoginGUI:Clone()
NewGui.Parent = player:WaitForChild("PlayerGui")
NewGui.GetDiamond.Disabled = false
NextLogin.Value = Time + (12*60*60)
DataStore:UpdateAsync(player.userId.."NextLogin" ,function() return NextLogin.Value end)
end
wait(1)
end
end)
[/code]