Type something and teleport to another place

Hello to everyone, i’m trying to find a way to make the player teleport to another place when typing something in the chat. I can’t find any tutorial or script as of now.

Just set a Player.Chatted event and teleport when a message is detected

local phrase = "yourphrasehere" -- put your chat message here
local placeID = 1902840114 -- put your place id here

game.Players.PlayerAdded:Connect(function(player)
    player.Chatted:Connect(function(message)
        if message:lower() == phrase then
            game:GetService("TeleportService"):Teleport(placeID, player)
        end
    end)
end)

Just alter the variables to your need. Make sure the phrase you put in is lowercase.

2 Likes

i tried setting it up, but I didn’t quite understand what to do and so i randomly put some stuff and didn’t work. Maybe if you could be a little more specific of what do i need to add and where do i need to add it?
thanks

What @Polymecha is doing is checking each message that is sent by the player in chat, and if it is the correct one, teleporting the player to that place. Can you show us the script you made so that it can be corrected?

well, i put a module script in replicated storage. (i’m still learning, that’s why i might make some errors)

Module scripts don’t run on their own, they need to be required by and executed by some other script that is running. For your example, a normal script in ServerScriptService should work just fine.