Im making a little update notification and was wondering how to make it only show once so people don’t have to close it every time they rejoin the game
Make sure the datastore api is on in game settings
local DS = game:GetService("DataStoreService")
local Storage = DS:GetDataStore("Joined")
local function OnJoin(plr)
local suc,res = pcall(function()
local data = Storage:GetAsync(plr.UserId)
if data then
-- yes player did joined before.
else
-- player didn't joined before.
end
end)
if not suc then warn("Error couldn't load.") end
end
local function OnLeave(plr)
local suc,res = pcall(function()
Storage:SetAsync(plr.UserId,true)
end)
if not suc then warn("Error couldn't save.") end
end