Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Ways to create a custom character system?

Asked by 8 years ago

I don't have a script because the question regards where I should start off from scripting a character creation system.

RPGs have the ability to have custom characters based on races, etc. I was mainly interested on how I could make it so my custom characters will be loaded for the players based on their selection. How would I go about this?

StarterCharacter will be for all players sadly so that's not a solution.

Note: This is not about getting the script. I'm simply looking for the concept so I can script it myself.

2 answers

Log in to vote
0
Answered by
Pyrondon 2089 Game Jam Winner Moderation Voter Community Moderator
8 years ago
Edited 8 years ago

Really, all you need is some variables, a GUI, and (if you want to save their appearance), DataStore.

Here's a really basic example:

local player = game.Players.LocalPlayer
local avatar = player.Character or player.CharacterAdded:wait()

local skinColor = 1

local nextButton = --// Path to a GUI button.

nextButton.MouseButton1Click:connect(function()
    skinColor = (skinColor<5) and skinColor+1 or 1 --// A ternary operator; if the skin color is less than the max, add 1. Otherwise, set it to 1.
end)

Of course, this is a very basic example; you'd need much more to complete a character creation. But this is how you would go about creating it. Hope this helped.

EDIT: Forgot to add in how to apply those to the character. Assuming the variables from the above script exist:

local skins = {
    'Really red',
    'Really black',
    'Pastel brown',
    'Pastel orange',
    'Reddish brown'
}

for _, v in pairs(avatar) do
    if v:IsA('Part') then
        v.BrickColor = BrickColor3.new(skins[skinColor])
    end
end
0
Thanks for answering, but that unfortunately wasn't the answer I was looking for. However, I did realize what I could do is have a datastore that stores the player's given information for the custom rig I have, then create client scripts to control the character. This way, I can clone the custom character into the workspace and have the player control it. This idea was gained from your post, thank Objectly 49 — 8y
Ad
Log in to vote
0
Answered by 8 years ago
Edited 8 years ago

Well you can begin by first taking away everything the Player may enter into the game with (i.e. clothes, meshes, hats, etc.). Once you take into account everything they may have, you should then start giving them what you will allow in your game to customize. Maybe your game only allows shirts so you take away everything and give them Shirts, and so on. Here are the objects you have to look out for:

<Instance> Shirt (found in character model) <Instance> Pants (found in character model) <Instance>Decal (This one is the face, named "face", which can be found on a character's "Head") <Instance> CharacterMesh (found in character model) <Instance> Hat (found in character model) <Instance> Mesh (found in character's "Head"

Knowing all of this, you can figure out what you want to do. Now, note that not always a player will be carrying all of this, so keep in mind that you should first check IF they have it and then remove or do as you will with it. Also remember that everytime a character resets that he will re-load all his gear so you must take it away again everytime he resets or his humanoid dies.

Hope I helped :D

Answer this question