Changing the StarterCharacter model

Alright, to keep it plain and simple, I have a script that changes the player’s character model, but adds their appearance on top of the model. I’m really using it for armor, and the easiest way I have found to do this is by temporarily setting the StarterCharacter the model and refreshing the player. (I haven’t felt like going through the math to add a couple parts for the sake of visuals)

There’s something I’m worried about however, that player appearance, rather the starter character, would accidently bug to this dummy model if a respawn is timed right. I might just be being paranoid, but I don’t to make something inherently bugged.

Edit: The whole problem is that the StarterCharacter should only be for one player. I didn’t feel like I made that clear.

Here’s my script, just for reference:

	local Appearance = game.Players:GetHumanoidDescriptionFromUserId(UserID)
	Dummy.Humanoid:ApplyDescription(Appearance)
end
buffer = false
script.Parent.Touched:Connect(function(part)
	if part.Parent:FindFirstChild("Humanoid") then
		if buffer == false then
			buffer = true
			local Player = game.Players:FindFirstChild(part.Parent.Name)
			local AV = game.Workspace.StarterCharacter:Clone()
			AV.Parent = game.StarterPlayer
			Player:LoadCharacter()
			CreateOfflineCharacter(Player.UserId, Player.Character)
			AV:Destroy()
			wait(0.5)
			buffer = false
		end
	end
end)
4 Likes

Nevermind, I found a more viable solution. You just have to change Player.Character and make sure you follow the Avatar Loading Events, then you can load player appearance.

For anyone who wants my new script:

local function CreateOfflineCharacter(UserID, Dummy)
	local Appearance = game.Players:GetHumanoidDescriptionFromUserId(UserID)
	Dummy.Humanoid:ApplyDescription(Appearance)
end
buffer = false
script.Parent.Touched:Connect(function(part)
	if part.Parent:FindFirstChild("Humanoid") then
		if buffer == false then
			buffer = true
			local Player = game.Players:FindFirstChild(part.Parent.Name)
			local AV = game.Workspace.StarterCharacter:Clone()
			AV.Name = Player.Name
			AV.Humanoid:Destroy()
			part.Parent.Humanoid.Parent = AV
			Player.Character = AV
			AV.Parent = game.Workspace
			wait()
			CreateOfflineCharacter(Player.UserId, Player.Character)
			wait(0.5)
			buffer = false
		end
	end
end)
3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.