Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

[EASY] - Need help swapping character models?

local CharModel = game.Workspace.Explosive:Clone()

game.Players.PlayerAdded:connect(function(plr)
	plr.CharacterAdded:connect(function(char)
		char:Destroy()
		print("Mwahahahahaha")
		char = CharModel
	end)
end)

Basically, I want the player joining to have his/her character destroyed and the character being changed to CharModel, the variable for a model named Explosive (which has a humanoid and head in it.)

However, when I test it.. It shuts my game down on joining.

1 answer

Instead of your current code inside of CharacterAdded, try this.

local nchar = CharModel:Clone();
nchar.Parent = workspace;
nchar:MakeJoints();
player.Character = nchar;
char:Destroy();

That might work a little better.

This discussion is preserved as it was. New answers, comments, and votes are closed.