local DataStoreService = game:GetService("DataStoreService")
local PlayerData = DataStoreService:GetDataStore("PlayerData")
[Link]:Connect(function(player)
if PlayerData:GetAsync([Link].."-HasSeen") then
wait()
else
print("You have Not Joined Before")
end
end)
[Link]:Connect(function(player)
local data
local success, err = pcall(function()
data = PlayerData:GetAsync("playerdata"..[Link])
end)
if data and success then
print("You Have Joined Before")
else
print("First Time Joining")
end
if success then
print("success")
if data then
print("data Collected")
-- data is a table
else
end
else
warn(err)
end
end)
-------------------------------------------------------------
[Link]:Connect(function(player)
local data = {}
local success, err = pcall(function()
PlayerData:SetAsync("playerdata"..[Link], data)
end)
if success then
print("data saved")
else
player:Kick("Error While Loading Your Data")
warn(err)
end
end)