local Data = game:GetService("DataStoreService"):GetDataStore("GeneralSaveData")
if Data.Visits:GetAsync(player.userId) == nil then --can I do this with .visits
Data.Visits:SetAsync(player.userId,true)
Data:GetAsync(player.userId).LastTime = tick()
while wait(1) do
game:GetService("TeleportService"):Teleport(36382221,player) -- tp player
end
end
I was wondering if Data.Visits can be used as a subcategory of the datastore. Would this script do what is intended and only teleport you the first time you visit the game? Also is there any improvements that can be made to this script so it has 0 possibility of erroring.
Thanks!
