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
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.
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
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.