When using
:GetDataStore()
things save completely fine.
When using
:GetGlobalDataStore()
local Data = {}
local Http = game:GetService("HttpService")
--------
local DS = game:GetService("DataStoreService")
local CodeDS = DS:GetGlobalDataStore("asdasd333334dsf")
--------
local RepStorage = game:GetService("ReplicatedStorage")
local ServerStorage = game:GetService("ServerStorage")
function Data:CodeRedeemed(userId, code)
wait()
CodeDS:SetAsync(tonumber(userId).."_"..code, "Redeemed")
warn'SET'
end
function setCodes(player, code)
if Data:CheckIfRedeemedCode(player.userId, code) then
warn'Code already redeemed'
else
Data:CodeRedeemed(player.userId, code) warn'Redeeming Code'
end
end
function Data:CheckIfRedeemedCode(userId, code)
if CodeDS:GetAsync(tonumber(userId).."_"..code) == "Redeemed" then
return true
else
return false
end
end
game.Players.PlayerAdded:connect(function(player)
wait()
if Data:CheckIfRedeemedCode(player.userId, "230-823-392") then
warn'WHAT THE adsaddddddd'
end
end)
game.ReplicatedStorage.code.OnServerEvent:connect(setCodes)
What am I doing wrong here?

4 comments
Tricky
Anyone :o
Lol, I was hoping someone could answer so that I could understand this better as well.
come on people...