Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Help with TeleportService not working on a simple Tp script?

Script suppose to Teleport whoever clicks part to that Id, not working though.

local Part = script.Parent
local CD = Part.ClickDetector

local GameId = 454058684

CD.MouseClick:connect(function()
	game:GetService('TeleportService'):Teleport(GameId)
end)

1 answer

✓ Accepted answer

I'm assuming this is a script located inside a part.

Also make sure to use a regular script, not a localscript.

You forgot to tell it which player to teleport

local Part = script.Parent
local CD = Part.ClickDetector

local GameId = 454058684

CD.MouseClick:connect(function(player)
    game:GetService('TeleportService'):Teleport(GameId,player)
end)

We added player argument

CD.MouseClick:connect(function(player)

then told it who to teleport him/her

game:GetService('TeleportService'):Teleport(GameId,player)

Hoped this helped.

2 comments

0

It's called an argument

0

Thanks for correcting me.

This discussion is preserved as it was. New answers, comments, and votes are closed.