Teleporting A Player To A Different Game

Hi I’m trying to make a player teleport to another place when they touch a part. There is an error in line one but I don’t know what it is. Could you please depict my code (I tried but I’m very new to this).

local TeleportService = game.GetService("TeleportService")

local Place = 4800310604

script.Parent.Touched:Connect(function(hit)

local player = game.Players:GetPlayerFromCharacter(hit.Parent)

if player then

TeleportService:Teleport(4800310604, player)

end

end)

Thanks for reading

Dont use “.”, Use “:”

game:GetService("TeleportService")
1 Like

Funny enough, that wouldn’t actually create a difference, they’re both valid syntax.

@Play_MazeOfHeck can you show us the error?

11:11:05.604 - Script ‘Workspace.Part.Script’, Line 1

Perhaps what @Conejin_Alt said is correct, replace . with :

1 Like