Game Teleport Script Error

This script is not working and I don’t know why, is anyone able to help?

local TeleportService = game:GetService(“TeleportService”)
local Place = (ID)

script.Parent.Touched:connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
TeleportService:Teleport(Place, player)
end
end)

the place id is where I’ve put ‘ID’, however I removed it and changed it to ‘ID’ for the sake of posting this.

I copied your code and got this error:
Workspace.Part.Script:1: Unexpected Unicode character: U+201c. Did you mean '"'?

The quotes you put around TeleportService are a different unicode character.
Copy this and replace your first line with it:

local TeleportService = game:GetService("TeleportService")

Did this work for you? When I used my code earlier and went into a game it didn’t work and did not give me an error in the console either. I tried your code and it did the same.

It worked fine for me.
Where is the part in your explorer? Is your script a regular script or a local script?
Try adding a print after every line to see where the code stops.

Nevermind - I believe I found the issue. The script was local.

1 Like