Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I cause a player to be teleported to a tutorial?

Asked by 5 years ago

So I have this game which has a place connected to it for the tutorial. I want a player who has joined for the first time to be sent to the tutorial immediately. I've looked for a forum on this but none have been found by me yet /:.

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

You can use DataStoreService to check if a player joined before, and then if they didn't, you can use TeleportService to teleport them to another place.

local DataStoreService = game:GetService("DataStoreService")
local TeleportService = game:GetService("TeleportService")
local Players = game:GetService("Players")

local DataStore = DataStoreService:GetDataStore("Players")
local TutorialPlaceId = 0

Players.PlayerAdded:Connect(function(player)
    if not DataStore:GetAsync("PlayedBefore") then
        TeleportService:Teleport(TutorialPlaceId,player)
    end
end)
Ad

Answer this question