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

Male or Female Starter Characters aren't working?

I have a prompt that asks if the user would like to be male or female in the game. When you click the male button, the male starter character is used, and when you click the female button, the female starter character is used, but for some reason neither starter characters are being implemented. Does anyone know why?

Male Button Local Script:

local btn = script.Parent
local camera = game.Workspace.CurrentCamera
local MaleCharacter = game.Workspace.StarterCharacter1
local StarterPlayer = game:GetService("StarterPlayer")

btn.MouseButton1Click:Connect(function()
	btn.Parent.Visible = false
	btn.Parent.Parent.PlayButton.Visible = true
	btn.Parent.Parent.CreditsButton.Visible = true
	btn.Parent.Parent.ChangelogButton.Visible = true
	MaleCharacter.Parent = StarterPlayer
	MaleCharacter.Name = "StarterCharacter"
end)

Female Button Local Script:

local btn = script.Parent
local camera = game.Workspace.CurrentCamera
local FemaleCharacter = game.Workspace.StarterCharacter2
local StarterPlayer = game:GetService("StarterPlayer")

btn.MouseButton1Click:Connect(function()
	btn.Parent.Visible = false
	btn.Parent.Parent.PlayButton.Visible = true
	btn.Parent.Parent.CreditsButton.Visible = true
	btn.Parent.Parent.ChangelogButton.Visible = true
	FemaleCharacter.Parent = StarterPlayer
	FemaleCharacter.Name = "StarterCharacter"
end)

1 answer

✓ Accepted answer

The reason this is happening is because when you are trying to set the new StarterCharacter the current player character is already loaded. This means you will have to replace the current loaded StarterCharacter.

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