Hey there! I recently started working on a game and I’m have a bit of trouble with a script. Basically, when a GUI button is pressed, it loads up a specific starter character. I have tried to do different morph scripts and tried to relate them back to the GUI but I still cannot figure it out. Thanks!
I would do it by having a frame containing all the buttons, and firing the button’s name over to the server using a loop. The buttons name would be the same as your team’s name to identify on the server. On the server, receive the button’s name and change the player’s team to match it.To change the character, I would use HumanoidDescription and apply that.
Here’s a picture of what I did below:
(Ignore the black boxes. They were just lines of pretty much the same thing.)
You can manually set a custom character using the player’s character property.
All you have to do is player.Character = customRig
and Roblox will do the work for you.
(Note: This kills the humanoid and resets all LocalScripts that isn’t under a GUI with the ResetOnSpawn behavior off)