Teleport Service Is Broken (._.)

Hello! Im trying to make it so when the player touches a part they will be teleported to another place inside the game (" I Mean teleporting through places ") But when I touch the part it doesnt do anything, I entered the code then touched the teleporter THEN Inside the Output this happened

  14:32:04.170  The Oof Box Factory auto-recovery file was created  -  Studio  -  C:/Users/mrtix/Documents/ROBLOX/AutoSaves
  14:32:14.163   ▶ 0 (x4)  -  Server  -  MasterScript:80
  14:32:16.963  Entered  -  Server  -  MasterScript:23
  14:32:18.232   ▶ exception while signaling: Cannot Teleport in the Roblox Studio. (x41)  -  Studio

Im in maximum confusion right now here’s the script.

local TeleportService = game:GetService("TeleportService")

local TeleportDestination = 6264488550

local function onPartTouch(otherPart)
	local player = game.Players:GetPlayerFromCharacter(otherPart.Parent)
	if player then
		TeleportService:Teleport(TeleportDestination, player)
	end
end
script.Parent.Touched:Connect(onPartTouch)
2 Likes

It says you can’t teleport in studio. Did you try publishing the game and teleporting from inside the game?

3 Likes

You can’t teleport in studio. Try testing your game using the actual client.

1 Like

From TeleportService on the api reference:

This service does not work during playtesting in Roblox Studio — To test aspects of your game using it, you must publish the game and play it in the Roblox application.

OK THIS IS PROBALY THE PROBLEM

lol now I feel dumb

I didnt publish the game actually so Ill try that

1 Like

ok its works

thanks @heII_ish and @MatkeFTW

1 Like