Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do make a player get teleported if they something in chat?

Asked by 5 years ago

I'm having trouble finding a good script for this so i'll ask here. What I need: When a player types for an example: "3591" The player will get teleported to some coordinates.

1 answer

Log in to vote
-1
Answered by
JakyeRU 637 Moderation Voter
5 years ago

Please provide explanation with your answers. Simply posting code does not spread knowledge of integral scripting processes which helps people understand the logic and reasoning behind your answer.
game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        player.Chatted:Connect(function(message)
            if message == "SecretMessage" then
                character.HumanoidRootPart.Position = Vector3.new(X,Y,Z) -- Change X,Y,Z with your position.
            end
        end)
    end)
end)

--[[
    The script will listen to player.Chatted event when his Character is added. If the variable
    message is "SecretMessage" then the script will change player's HumanoidrootPart to the position X,Y,Z.
--]]
Ad

Answer this question