for the past day I have not gotten much help and I am just lost. I am trying to make a mimic system where after you finish part one you and your party gets teleported to part two but it just wont work.
– My Code
local Players = game:GetService(“Players”)
local TeleportService = game:GetService(“TeleportService”)
local Players = game:GetService(“Players”)
local GameId = 11296869501
local DataStoreService = game:GetService(“DataStoreService”)
local dataStore = DataStoreService:GetGlobalDataStore()
local Teleported = false
– Get the saved code
local code = dataStore:GetAsync(“ReservedServer”)
if typeof(code) ~= “string” then – None saved, create one
code = TeleportService:ReserveServer(game.PlaceId)
dataStore:SetAsync(“ReservedServer”, code)
end
local function joined(player)
player.Chatted:Connect(function(message)
if message == “reserved” then
TeleportService:TeleportToPrivateServer(game.PlaceId, code, { player })
end
end)
end
Players.PlayerAdded:Connect(joined)