I’m making a simple script that teleports players from the game place to main lobby place.
Here is my script:
local Players = game:GetService("Players")
local TeleportService = game:GetService("TeleportService")
local LOBBY_PLACE_ID = 4287394397
local backToLobby = workspace.Lobby.GoBackToLobby
backToLobby.Touched:Connect(function(touch)
if touch.Parent:FindFirstChild("Humanoid") ~= nil then
local player = Players:GetPlayerFromCharacter(touch.Parent)
if player then
TeleportService:Teleport(LOBBY_PLACE_ID, player)
end
end
end)
When I step onto the teleport area, this error keeps popping up over in the console. I don’t have any teleports in process currently. It teleports me after tens of seconds. I don’t want that delay into my game. How could I fix this?
I have tried looking from DevHub and there is nothing about this error.