GetTeleportSettings and SetTeleportSettings doesn't work?

So I made a lobby where players can change their face and the actual game where players will play after customizing their character. I tried using GetTeleportSettings and SetTeleportSettings but I don’t think they work. I even tried to make the lobby the start place of the actual game but it didn’t work either.
This is the script I put in a local script inside a ScreenGui:

local player = game:GetService("Players")
local TeleportService = game:GetService("TeleportService")
local teleportData = TeleportService:GetLocalPlayerTeleportData()

local face = game.Players.LocalPlayer.Character.Head.face.Texture
TeleportService:SetTeleportSetting("face", face)

script.Parent.Spawn.MouseButton1Click:connect(function() --this will make the the player teleport after they click "Play"
TeleportService:Teleport(3496476345, player, face)
end)

And this is the script I put in the place that receive the teleport:

local TeleportService = game:GetService("TeleportService")
local face =  TeleportService:GetTeleportSetting("face")

Can someone tell me whether if my script was wrong or this feature is removed because there wasn’t any error.

you didn’t assign the face to the player at the place that recieves the teleport. aside from that everyone that gets teleported at the same time will get a face change. it’s best to use datastore for this instead of teleportsettings if the game has sub placed atleast.

using teleport settings at all for anything customization related isn’t that good

1 Like

I don’t seem to see any issues with the script, but why don’t you just use the TeleportData argument of the :Teleport() function? You already have lines of code hinting that you use it (line 3) and you already send the face variable using TeleportData.

If you need to send multiple variables through TeleportData, all you have to do is to make it an array.

1 Like

sorry if i sounded noob, but i’m actually new to this so can you please explain a bit more how i can do it?
i actually did use TeleportData but i don’t know how it works so i just left it there

thanks! i’ll try using data store

When you use the function :Teleport() the third argument is called TeleportData. Here you can send data through the teleport such as your face variable, which you have already done.

In the recieving place, you can simply use the function :GetLocalPlayerTeleportData() of TeleportService and it will return the value you passed, in this case the face value.

If you want to pass more than one value through the TeleportData function in the future, you can use an array.

If my explaination wasn’t clear enough, you can check out the developer hub page for more information: TeleportService | Documentation - Roblox Creator Hub

3 Likes

He’s basically saying send a table of all the info you need, if you need more than one thing.

TeleportService:Teleport(3496476345, player, {face, ...})

... would just be the data you want to send.

Though since this is from a client, it may have been tampered with so you should check that the data is valid.

2 Likes

thanks both of you for answering~
may i ask one more thing? where would the script in the teleport receive place be in?

Be sure to mark one of 0skarian’s posts as the solution if it helps.

2 Likes

Since you’re teleporting using the client, it should be recieved there too. In other words, somewhere in StarterGui/StarterPlayer.

1 Like