Help needed with StarterCharacters

This is the best category i could find for this, comment a better one and i’ll move it.

I recently have been trying to make a StarterCharacter spawn randomly for a game i have been making. I have tried multiple tutorials, looked all over the developer forums and DevHub and more. None of the things i did worked.

Can anyone help? Thanks in advance. :happy1:

1 Like

What do you mean spawn randomly? The starter character is the character every player will spawn in as, in the game. They cannot be spawned. Do you simply want to spawn in NPC’s?

3 Likes

By spawn randomly, i mean that every time a player dies that player turns into another randomized character than the one they were before.

1 Like

You would probably use morph characters.

1 Like

And how would i make that? And by morphs do you mean those “pads” that turn you into a character?

Instead of using those “pads” make it automatic so when they die, they respawn as a different character.

That was my initial problem; i tried all solutions from around the devforums.

1 Like

Here is a script which morphs the character. I use it in my game.

local myMorphCharacter = nil -- DO NOT MAKE NIL, SET THIS TO YOUR CHARACTER

function morph(player, morphName)
	local newCharacter = game.ReplicatedStorage.Characters:FindFirstChild(morphName):Clone()

	newCharacter.Name = player.Name
	newCharacter.HumanoidRootPart.CFrame = player.Character.HumanoidRootPart.CFrame

	newCharacter.Parent = workspace

	player.Character = newCharacter
	game.ReplicatedStorage.Camera:FireClient(player)
end

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		morph(player, myMorphCharacter)
	end)
end)


Note: The Camera event fired in the function above, puts the camera in the right position as when you morph, it screws up the camera for the player.

I will edit this for random player spawning.

1 Like

Actually, would it be fine if they used their character but changed their clothes, face, etc…

I don’t think so.

Also, for that other script, are there any aditional folders or things i need to add?

1 Like
  1. In replicated storage, put a folder called “Characters” and insert all of the morph characters you want inside.

  2. The myMorphCharacter variable needs to be the name of the character in the folder I mentioned above.

  3. You also need a remote event in replicated storage called “Camera”.

Can the script go in the Workspace?

I use ServerScriptService but I guess you can use the Workspace

Ok. Also, do i use the full path or just the name of the Character(s)?

You use the name of the character. A string.

I have multiple characters, do i put them in the myMorphCharacter or a table?

So if my model is named Bob and he is in game.ServerStorage.Bob, do i place in “Bob”?

1 Like

Just tried my script with the string as the name and etc.

local myMorphCharacter = "BettyBloxxer"

function morph(player, morphName)
	local newCharacter = game.ReplicatedStorage.Characters:FindFirstChild(morphName):Clone()

	newCharacter.Name = player.Name
	newCharacter.HumanoidRootPart.CFrame = player.Character.HumanoidRootPart.CFrame

	newCharacter.Parent = workspace

	player.Character = newCharacter
	game.ReplicatedStorage.Camera:FireClient(player)
end

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		morph(player, myMorphCharacter)
	end)
end)

Everything worked, but a normal version of my avatar popped up, i can’t control it.
I did spawn in as BettyBloxxer, but with no animations. I could move.

I believe changing a player’s ‘characterappearanceid’ would work better than replacing their character each time they spawn in with a script.

https://www.bing.com/videos/search?q=gnomecode+characters&docid=608036574592850428&mid=4E7A75CCDD1D10A26FD74E7A75CCDD1D10A26FD7&view=detail&FORM=VIRE