Players choosing their StarterCharacter

I need to find a way for people to chose their StarterCharacter. (Examples in murder island 2 on roblox)

Except I don’t know how to set that player’s character as the one they chose, I only know how to set a default StarterCharacter for all players playing

I tried maybe setting multiple StarterCharacters and maybe the game randomly choosing the players except that if I want to make a camping game, I need them to have 1 player per character, which doesn’t really work like that unless you have really good luck and that’s not good scripting. Also the game just chooses one of them to be everyone’s appearance. I am not that good of a scripter and have been scripting for over a year now. Please help!

(Sorry I couldn’t include any images, i’ll look for some to add)

3 Likes
script.Parent.Mousebutton1click:Connect(function()
   player.Character = game.ServerStorage.John
end)

simple as that, or you coulduse humanoid descriptions

3 Likes

It isn’t working, I don’t know why. These images are in order of when I took them


You need to clone the ‘John’ character and parent the clone to workspace, once done you can set the .Character property to the cloned character.

Also, are you using .MouseButton1Click in a script? That event will only fire on a localscript. I would imagine you’d need to set the player’s character on the server also. i.e. you would need to do this via a remote event once the player clicks the button, then on the server you need to change the character.

2 Likes
while true do
if game.ReplicatedStorage.ChangeCharacter = ???

end

that wasn’t the actual script… more of a example… here;

local plr = game:GetService("Players").LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
   plr.Character = game:GetService("ServerStorage").John
end

local script

should work, end might need to be end)

1 Like

If it’s just a non-custom rig character, you can use HumanoidDescription instead.

1 Like

Why doesn’t that work? I’ve tried it and it doesn’t work…

local plr = game:GetService("Players").LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
	plr.Character:Destroy()
	local char = game:GetService("ReplicatedStorage").John
	plr.Character = char
	char.Parent = workspace
end)

maybe try to fix it yourself before asking questions. but that code works

1 Like

Yeah. I’m sorry I haven’t learned this in scripting. Thank you though @ekuz0diaa, It worked! Except that it changes to that character only for a couple of seconds

--change the script to local
--Client
local debounce = false
script.Parent.MouseButton1Click:Conect(function()
if  debounce == true then return end
debounce = true
       local char = 'John'
       local event = game.ReplicatedStorage:WaitForChild('ChangeChar')
       
event:FireServer(char)
end)

--Server
 local event = game.ReplicatedStorage:WaitForChild('ChangeChar')
event.OnServerEvent:Connect(function(plr, char)
character = game.ServerStrorage[char]:Clone
if not character then return end
character.Parent = workspace
plr.Character:Destroy()
plr.Character = character
end)

You can try this, make sure ChangeScript is a remote event in RS

1 Like

This?

Move the code under --Server to a script inside server script service. And you didn’t make a remote event that says ‘ChangeChar’

3 Likes