How would I teleport more than 1 person to another game in ONE server instead of distributed across random servers. Not sure how else I can elaborate.
1 Like
TeleportService:TeleportPartyAsync
https://developer.roblox.com/en-us/api-reference/function/TeleportService/TeleportAsync
1 Like
I mean in another person’s game.
1 Like
Hopefully this should help
local players = game.Players:GetChildren()
local tps = game:GetService("TeleportService")
local gameid = [YourGameIDHere]
local canTeleport = true
local function teleportPlayers()
local humanoid = players.Character.Humanoid.Parent
if humanoid and canTeleport then
canTeleport = false
wait(However long you want to)
tps:Teleport(gameid, humanoid)
end
end
2 Likes
Thank you SO much!
Tip: Make sure to explain everything too so you aren’t spoon feeding code to others. Luckily I actually take a good look instead of copy and pasting it.
1 Like
Oh yeah, my bad. Usually I just write code without putting comments, but I can if that would make it easier
1 Like
I’ve also fixed your code. ^^
local players = game.Players:GetChildren()
local tps = game:GetService("TeleportService")
local gameid = 0
local canTeleport = true
local function teleportPlayers()
local humanoid = players.Character.Humanoid.Parent
if humanoid and canTeleport then
canTeleport = false
wait(0)
tps:Teleport(gameid, humanoid)
end
end
Before:
local players = game.Players:GetChildren:()
local tps = game:GetService:("TeleportService")
local gameid = [YourGameIDHere]
local canTeleport = true
local function teleportPlayers()
local humanoid = players.Character.Humanoid.Parent
if humanoid and canTeleport then
canTeleport = false
wait(However long you want to)
tps:Teleport(gameid, humanoid)
end
end
Errors: Unnecessary colons
1 Like
Sooooo sorry, did not notice that
2 Likes
No worries!
CurseCharacterLimit
1 Like