How to teleport to a private server in a place? (Like Tower Defense Simulator's teleport system)
I have a question to ask, I'm working a Tower Defense game on Roblox, and I've made a simple teleport script (as shown below). It's a place not a game that you teleport to. When you teleport it works but a player can join while mid-game, which I don't want. I want it like or similar to the teleportation system in Tower Defense Simulator and other games that use a similar way/style.
I would love it if someone helped me! <3
~ notreallysupernova
01 | local MapCollection = 5770100191 |
02 | local MapID = MapCollection |
04 | function onTouched(hit) |
05 | local player = game.Players:GetPlayerFromCharacter(hit.Parent) |
06 | game:GetService( "TeleportService" ):Teleport(MapID, player) |
10 | script.Parent.Touched:connect(onTouched) |
12 | print ( "Teleported to " .. MapID) |