I am trying to make this sandbox game but to join a user's sandbox, you must have a code. I want to know how to make a "room" inside the game that can only be accessible by a key. It's going to be something like Meep city party's, where its a "room" inside the game, Meep city. Thanks!
✓ ANSWER ACCEPTED
How would I make a "room" inside a server?
1 answer
✓ Accepted answer
This site is okay for scripting questions. iiConstable_Subwayx has been targeting asking questions.. So sad of a life, But here!
local TPS = game:GetService("TeleportService") --Get the teleportation service so you can teleport to a private game
local code = math.random(10000, 99999) --Generate the code for using the private server. This could also be used in GUI's
local GameID = 123456789 --Put your GameID here
script.Parent.Touched:Connect(function(player) --Put this script in a brick. On touch it will teleport you to a private server as well as other people to this server
TPS:TeleportToPrivateServer(GameID, code, player) --Teleports to the private game server. This could also be used to teleport to an existing private server via the "code" part.
end)
3 comments
0
Thank you so much!
0
Please read the site guidelines before targeting other users and the one against providing users with free scripts. Giving people code before they attempt themselves won't help them. You as a moderation voter should already know this: https://scriptinghelpers.org/help/community-guidelines
0
bruh chill, it's an example, I am going to make that wayyy more complicated.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Read the rules before posting, this site is for people looking for help with their existing code