i want to make the script i have work so that when someone first joins my game a gui pop's up, i got this script from someone but it dont work. Here's the script:
local DataStoreService = game:GetService("DataStoreService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local JoinData = DataStoreService:GetDataStore("JoinTest")
local function CheckIfJoined(Player)
print('Player Joined, Now Checking...')
local Success, Response = pcall(JoinData.GetAsync, JoinData, Player.UserId)
if (Success) then
local Joined = select(1,unpack(Response))
print('Checking...')
if not (Joined) then
print('First Time')
SetJoinData(Player)
end
else
warn(Response)
end
end
local function SetJoinData(Player)
local JoinInformation = {
Joined = true;
Date = os.date('%x');
UnixTimeStamp = tick()
}
JoinData:SetAsync(Player.UserId, JoinInformation)
end
Players.PlayerAdded:Connect(CheckIfJoined)
it keeps giving me the error bad argument #1 (table expected, got nil) can someone please help me and explain what it mean?

5 comments
pretty sure theres a rule which states that the code has to be yours, not taken from a free model or from a friend.
oh well i dont know how to make a first joined script so i ask for help hen i got this and i tried it and it didnt work, after that i didnt get any response
oh, fair enough I guess.
Ah, this is my old work. It's pretty broken; Response isn't set, but the request is successful, so it tries to get Join data from an empty table.
so then what do i do?