Every player morphs into a certain character when they join/get reset

Problem


For quite a while now, I’ve been working on a titan shifting system. So far it’s going well, though I’ve experienced a few bugs. One of which is whenever the player shifts, if a different player gets respawned, they turn into the titan as well. The script I’m using to transform the player into a titan is a server-sided one, I am aware that this is causing the problem, though I’m not sure how to fix it.

Code
game.ReplicatedStorage.Shifters.Attack_Titan.StarterCharacter = game.StarterPlayer -- Problem here
	player:LoadCharacter()

What I’ve tried

I’ve tried transferring that line to a local script, but that didn’t work, and either way, it would be client-sided, which I don’t want.

I’ve tried other code such as:

player.Character = game.ReplicatedStorage.Shifters.Attack_Titan.StarterCharacter -- Recommended to me, by the way

I’ve also tried Humanoid:ApplyDescription, which wouldn’t work as far as I know since it’s a different rig.


So now I’m left with no choice but to post a thread with this problem, hope this can be solved fast and efficiently, thanks!

Try to create a folder for each player
Something like:

local directory = game.ReplicatedStorage.Shifters.Attack_Titan.StarterCharacter

-- if you want to save the players characters [CODE NOT TESTED]
game:GetService("Players").PlayerAdded:Connect(function(player)
    local folder = Istance.new("Folder", directory)
    folder.Name = player.Name
    player.CharacterAdded:Connect(function(character)
        directory[player.Name] = character:Clone()
    end)
end)

-- if you want to set a custom character [CODE NOT TESTED]
game:GetService("Players").PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character) -- This allow you to call this function every time the player spawn
        player:LoadCharacterWithHumanoidDescription(directory["Titan"].HumanoidDescription)
        -- just make a custom humanoid description
    end)
end)

-- if you want to set the saved character [CODE NOT TESTED]
player:LoadCharacterWithHumanoidDescription(dictionary[player.Name].Humanoid:GetAppliedDescription()) -- or you can just save the description and not the whole character

You see, the problem with this is, you can’t switch to r15 in-game at least from what I know, meaning you can’t change the size of the player to be titan sized.

Can’t you set the game to R15 and then switch to R6 if necessary?

https://www.roblox.com/library/6431788471/R6-Switch

Bump, but I got a solution, basically at the end I just added this line:

game.StarterPlayer.StarterCharacter:Destroy()