I am trying to make a game about the anime "Shingeki no Kyojin". I have some character models for some of the characters and I am trying to make a dev panel where you can switch from 1 character to another. The problem is since i need the character's name to match the players name for other scripts i need to make, if you switch from one character to another, you cant switch back to the one you first selected. I dont even know how to fix this.
Srry if the script is bad i've been scripting for about 1 year 4 months now.
local CharacterEvents = game.ReplicatedStorage.CharacterEvents local Characters = game.ReplicatedStorage.Characters local ErenModel = Characters.Eren:Clone() local ArminModel = Characters.Armin:Clone() CharacterEvents.Eren.OnServerEvent:Connect(function(player) local PlayerPos = workspace:WaitForChild(player.Name):GetPrimaryPartCFrame() ErenModel.Name = player.Name player.Character = ErenModel ErenModel.Parent = workspace ErenModel:SetPrimaryPartCFrame(PlayerPos) end) CharacterEvents.Armin.OnServerEvent:Connect(function(player) local PlayerPos = workspace:WaitForChild(player.Name):GetPrimaryPartCFrame() ArminModel.Name = player.Name player.Character = ArminModel ArminModel.Parent = workspace ArminModel:SetPrimaryPartCFrame(PlayerPos) end)
Well, I don't understand what did you mean but try to instead of trying changing the name of the player change DisplayName, I am not certain that it will work out but it's worth a try I guess