Hi, I’m trying to make a demon slayer sort game kinda like project slayers. I’m at a part in my coding where I just can’t find a soulution to, so thats why im posting here as a last resort. I made a character customization which is a seperate place from the main game. I’m trying to send over data using teleport service to the main game.
Game 1: (Server)
local TeleportService = game:GetService("TeleportService")
local function teleportPlayer(player)
local characterModel = player.Character
local characterData = characterModel
local teleportData = {
characterData = characterData
}
TeleportService:Teleport(15641747325, player, teleportData)
end
event.OnServerEvent:Connect(function(plr)
teleportPlayer(plr)
end)
Game 2: (Client)
local teleportData = game:GetService("TeleportService"):GetLocalPlayerTeleportData()
local characterData = teleportData.characterData
local player = game.Players.LocalPlayer
if teleportData and characterData then
print("Character Model:")
print(characterData)
local current = workspace[player.Name]
current:Destroy()
player.Character = nil
player.Character = characterData
characterData.Parent = game.Workspace
else
error("Error with data")
end
Any feedback is appreciated!