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 forall 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)
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.
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
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