So Im trying to get this to teleport to the second place in after the starting place for this game
local TeleportService = game:GetService(“TeleportService”)
local gameID =
function onTouched(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
TeleportService:Teleport(gameID, player)
end
end
script.Parent.Touched:connect(onTouched)
Thats the code
I mean your code should work from what I am seeing. Why don’t you test it first in an actual game to see if it works? Also next time you make a topic remember to format your code by doing ``` twice so that it is easier for others to read your code.
For future reference please utilise the Play button in Roblox Studio, for things like telelporting to different games you should join the actual game and test it yourself, “Scripting support” is designed for scripting issues generally and not so much asking if your code works as you can test it yourself. In addition to this you have the lovely Documentation - Roblox Creator Hub which provides code examples to all services which you can compare your code to. Hope this advice helps.
/```
With out the /, so your code can look like this:
local TeleportService = game:GetService(“TeleportService”)
local gameID =
function onTouched(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
TeleportService:Teleport(gameID, player)
end
end
script.Parent.Touched:connect(onTouched)
It’s easier to read it and let other developers help you.