Chat to teleport another game (Group Rank)

  1. What do you want to achieve? Make chat to teleport to another game.

  2. What is the issue? Errors. TeleportOptions

  3. What solutions have you tried so far? Yes but there were no solutions.

local messageRequired = "!Training" --here the name of the command
local player = game:GetService("Players")
local TeleportService = game:GetService("TeleportService")
local TARGET_PLACE_ID = 1234 -- replace with your own place ID
local playerToTeleport = player:GetPlayers()[1] -- get the first user in the experience

player.Chatted:Connect(function(message)
	if message == messageRequired then
		if player:GetRankInGroup(13566661) >= 3 then
			TeleportService:TeleportAsync(TARGET_PLACE_ID, {playerToTeleport}, teleportOptions)
		end
		end
	end
end)

Why are you making this specific to the first player who joins? Also did you replace TARGET_PLACE_ID with your own id?

Actually, I am putting this script in ServerScriptService…

Ok, but why are you making this specific to the first player who joins? Is it a one player server?

Yes. It is a one player server.

And you replaced the TARGET_PLACE_ID with your own id, and you’re testing on the roblox player after you published the game?

There is a error inside.
Also, I can put to ServerScriptService?

Well, there’s no teleportOptions variable then. I don’t think you would need it though. I barely use teleportservice so I don’t know how to make those options, you should look at this article.

1 Like

Can you tell me how can i do the chat to teleport to another game?

The rest of the code should work fine.

I will go rescript. Thank you.

local ts = game:GetService("TeleportService")

game.Players.PlayerAdded:Connect(function(player)
	player.Chatted:Connect(function(message)
		if player:GetRankInGroup(13566661) >= 3 then
			if message:lower() == "!training" then
				ts:Teleport(12120116189, player)
			end
		end
	end)
end)
1 Like

I was trying to do that. :joy:

local GameId = 12120116189 --Set this gameId to what game you want to teleport to.


game.Players.PlayerAdded:Connect(function(player)
	player.Chatted:Connect(function(Msg)
		if Msg == "!training" then --Customize command.
			TeleportService:Teleport(GameId, player)
		end
	end)
end)
1 Like

Thank you so much! It works! :slight_smile:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.