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

Script to teleport players isn't working. Worked in studio and not ingame?

Asked by
Zjyuak -1
4 years ago
Edited 4 years ago

Hey there, I tested this For a friend the other day and it seemed to work. in the output it said it wont work in studio which was good. I went into the game and it didnt work. The script is just a script and is in ServerScriptService. Please if you could help reply to it!

local Players = game:GetService("Players")
local TeleportService = game:GetService("TeleportService")
local chatcommand = "The priest will be scarificed" --change to whatever you want
local destinationID = 4908897649 --Change to destination place ID

Players.PlayerAdded:Connect(function(player)
    player.Chatted:Connect(function(message)
        if message:sub(1, chatcommand:len()):lower() == chatcommand then
            TeleportService:Teleport(destinationID, player)
        end
    end)
end)

0
Is your game Team Create? ghxstlvty 133 — 4y
0
I can make it. Zjyuak -1 — 4y

Answer this question