so when someone changes there character in a main lobby and then they want to play the main game there character gets saved so the script can load it in the new server
ive tried using teleport data with HumanoidDescription but it prints out lighting its like its not there for the server
ive tried most of the things i can’t find much on the wiki and dev forums and not much on yt
Instead, you would want to make a table and send it that way, ie:
{12345, 12345, 12345, "blue"}
All you have to do is put the values you need to save in a table and send that instead, then take those values and use them on a created humanoid description.
If you are using universes you can use Datastores, this will also let your player have their character auto loaded whenever they join the main game if you want it to.
okay. would i have to save the HumanoidDescription? before they leave and when they come back it loads the recent HumanoidDescription? or would i have to save everything in the model like hats ect? i dont know a correct way of doing this sorry.
cc @Tom_atoes
Using data stores for going from place to place isn’t reliable; And it requires lots of checks to make sure data loads correctly, and if it doesn’t then you have even more problems.
For simply sending customization data, I would just use TeleportData. If you want player’s customization to save when they leave the game, then implement data stores.
script.Parent.MouseButton1Click:Connect(function()
local ts = game:GetService("TeleportService")
local data = {
workspace.HumanoidDescription.HairAccessory,
workspace.HumanoidDescription.Face,
workspace.HumanoidDescription.GraphicTShirt}
ts:Teleport(4612082724,game.Players.LocalPlayer,data)
end)
Local script pick up teleportdata
local ts = game:GetService("TeleportService")
local data = ts:GetLocalPlayerTeleportData()
if data then
game.ReplicatedStorage.RemoteEvent:FireServer()
end
SERVER SCRIPT
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(plr,data)
wait(5)
print("made description")
local humanoid_Description = Instance.new("HumanoidDescription")
wait(1)
print("named it")
humanoid_Description.Name = "HumanoidDescription"
wait(1)
print("in workspace")
humanoid_Description.Parent = game.Workspace
wait(1)
print("put the data on it")
humanoid_Description = data
wait(1)
print("load on character")
plr:LoadCharacterWithHumanoidDescription(workspace.HumanoidDescription)
wait(1)
script.Disabled = true
end)
I feel like an issue might occur here because at this point your setting the variable as the data you passed to it, instead of setting the properties of the object itself.
No problemo, hopefully it works. Never really made something like this; However I’m pretty sure they added a Server Sided TeleportData table now, so I’d look into that instead of letting the client control what they wear etc.
Info can be found here: Serverside method of getting player teleport data