How do I make a singleplayer/multiplayer option?

How do I make a singleplayer/multiplayer option in the main menu?

That means that the main menu and the game will be in two different places

If players choose single-player, they get teleported to a place with a server size of 1. If they choose multiplayer, they get matched up with other people choosing multiplayer

and how do i make a player teleport to a different server?

You have to make a separate place inside your game. Then go to Asset Manager. Double-click places, right-click the place you want to teleport the players in, and select Copy ID to Clipboard. Then in a script, you teleport the player.
Example code:

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

local TARGET_PLACE_ID = 1234 -- replace with your own place ID

local playerToTeleport = --the player you want to teleport

TeleportService:TeleportAsync(TARGET_PLACE_ID, {playerToTeleport}, teleportOptions)

1 Like