Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

I need help with Character Creator Gui???

So i am making a character creation gui and whenever i click it to change the skin color it only changes the head color and gives me an error "arm is not a valid member of model" please help this is the script Player =game.Players.LocalPlayer Character = Player.Character x = script.Parent.Value.Value script.Parent.MouseButton1Down:connect (function () Character.Head.BrickColor = x Character.Arm.BrickColor = x Character.Leg.BrickColor = x end)

3 comments

0

Please format your code using Lua code block.

0

Please do some research man. :/

1 answer

The problem is that the Arms and Legs of a a character are two separate objects which means they're named 'Right __' and 'Left ___' and not simply just 'Arm' or 'Leg'.

I've adapted your script to be slightly more fool-proof (with the use of WaitForChild in case the server is having a few issues) and then used the variables for the body parts in the same way you did for the head.

player = game.Players.LocalPlayer
character = player.Character
x = script.Parent.Value.Value

script.Parent.MouseButton1Down:connect(function()
	-- Locate the body parts
	local head = character:WaitForChild("Head")
	local r_arm = character:WaitForChild("Right Arm")
	local l_arm = character:WaitForChild("Left Arm")
	local r_leg = character:WaitForChild("Right Leg") 
	local l_leg = character:WaitForChild("Left Leg")
	
	-- Recolour said body parts
	head.BrickColor = x
	r_arm.BrickColor = x
	l_arm.BrickColor = x
	r_leg.BrickColor = x
	l_leg.BrickColor = x
end)

If this answered your question please accept my answer with the button somewhere over there ->

If this doesn't work let me know and if you have any questions feel free to ask.

3 comments

0

Hey so i tryed that script and it doesnt work

0

it comes up with this error Infinite yield possible on 'Workspace.Player1:WaitForChild("Right Arm")'

0

@AdamSineBoze Are you using a R15 rig?

This discussion is preserved as it was. New answers, comments, and votes are closed.