Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to check if its the players first time playing the game?

I am not quite sure on how to do this. I want to make it into an if statement.

2 comments

0

You'd have to use DataStores and a bool to check if they've been in the game before. Atleast, that's how I would do it.

0

An existing data or a game badge

1 answer

✓ Accepted answer

Either a game badge, or this code:

NOTE: To use DataStores in Roblox Studio, go to Game Settings and enable Studio Access to API Services.

local data = game:GetService("DataStoreService"):GetDataStore("playerJoin") -- Get datastore named playerJoin
game.Players.PlayerAdded:Connect(function(player)
pcall(function()
if data:GetAsync("join"..player.UserId) ~= nil then
data:SetAsync("join"..player.UserId,"this can be anything i guess")


-- Code herrre


end
end)
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.