|
|
| 13 Jul 2016 01:47 AM
|
I'm creating a game where you can create your own custom character, and I want to allow the user to have some control over their appearance.
For example, there could be multiple "hair" items, each of which has multiple colors. The player would select a color for each hair item they've chosen. Then, depending on how many hair items they've selected, they may either get one, two, three, or four randomly generated hairs with those colors.
This is what I have so far:
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local hairItem1 = script.Parent
local hairItem2 = script.Parent.Parent.Parent.Parent.Hair1
local hairItem3 = script.Parent.Parent.Parent.Parent.Parent.Hair1
local hairItem4 = script.Parent.Parent.Parent.Parent.Parent.Hair1
mouse.KeyDown:connect(function(key)
if key == "o" then
hair = math.random(1, #hairItems)
color = math.random(1, #colors)
hairItem1.HairColor.Value = color
end
end)
local hair = #hairItem1:GetChildren()
local color = #hairItem1:GetChildren()
I'm sure this code is very flawed, and it isn't even complete. Any help would be appreciated.
|
|
|
|
|
|
|
Report
Abuse
|
|
|
|
| 13 Jul 2016 01:49 AM
|
Also, this will be a group project, so if you do decide to help, you won't be able to take credit for the finished product.
|
|
|
|
|
|
|
Report
Abuse
|
|
|
|
|