How to teleport cloths between places

So, i have a main menu with a costomization screen where you can costomize your characters cloths, i want it so that when your done, the cloths teleport to the place you teleporting to from the main menu using pants and shirts Ids

1 Like

You can pass data with a teleport using TeleportData.

Alternatively, you can use DataStoreService, you would set the clothing IDs to a key on the menu place and then get and apply them in your other place.

Hope this helps!

1 Like

ive tried making my own script for it many times and it never works

What code do you have right now?

local selectButton = script.Parent
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()

local TeleportService = game:GetService("TeleportService")
local teleportOptions = Instance.new("TeleportOptions")

local teleportData = {
	Pants = character:WaitForChild("Pants").PantsTemplate
}


repeat wait() until script.Parent.Text ~= "Button"



selectButton.MouseButton1Click:Connect(function()
	if selectButton.Text == "Play" then
		
		
		TeleportService:Teleport(8657574891, player, teleportData)
	end
end)

This is the one i have in the main menu

Its in a local script under the button you have to press

This teleport should work fine, what’s your code on the other place?

This is the one in the actual game

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local TeleportService = game:GetService("TeleportService")
local Setpants = character:WaitForChild("Pants").PantsTemplate

local teleportData = TeleportService:GetLocalPlayerTeleportData()
if teleportData then
	local Pants = teleportData.Pants
	Setpants = Pants
end

Anything in the script output?

Lemme join the game in roblox to see

My wifi isnt that good, i cant join

Ok, so it says infinite yeild possible on 'Workpsace.Coolbro11741:WaitForChild(“Pants”)

This means there is no child named “Pants” in your character.

shouldn’t teleporting players between places must be done inside server script?

1 Like

How would i make that script done with a server script?

Use remote event. What you would do is

When player clicks that button. You would just do :FireServer and then inside the server script OnServerEvent, You would put the teleport codes. remember, You must put pcall when trying to teleport players.