So I've been making a character editor gui and it's supposed to set your appearance at the start of the game and let you select your appearance once you've opened up the gui but it only works in the studio. Can someone tell me what I'm doing wrong?

Here's one of the local scripts:

local Player = game.Players.LocalPlayer
local Character = Player.Character
local RB = script.Parent:WaitForChild("Right")
local LB = script.Parent:WaitForChild("Left")
local Type = script.Parent:WaitForChild("Type")
local SkinColorNumber = script:WaitForChild("SkinColorNumber")

RB.MouseButton1Down:connect(function()
	SkinColorNumber.Value = SkinColorNumber.Value + 1
end)

LB.MouseButton1Down:connect(function()
	SkinColorNumber.Value = SkinColorNumber.Value - 1	
end)


while true do
	if SkinColorNumber.Value < 1 then
		SkinColorNumber.Value = 5
	end
	if SkinColorNumber.Value == 1 then
		Character:WaitForChild("Head").BrickColor = BrickColor.new("Pastel brown")
		Character:WaitForChild("RightUpperArm").BrickColor = BrickColor.new("Pastel brown")
		Character:WaitForChild("LeftUpperArm").BrickColor = BrickColor.new("Pastel brown")
		Type.Text = "1"
	end
	if SkinColorNumber.Value == 2 then
		Character:WaitForChild("Head").BrickColor = BrickColor.new("Light orange")
		Character:WaitForChild("RightUpperArm").BrickColor = BrickColor.new("Light orange")
		Character:WaitForChild("LeftUpperArm").BrickColor = BrickColor.new("Light orange")
		Type.Text = "2"
	end
	if SkinColorNumber.Value == 3 then
		Character:WaitForChild("Head").BrickColor = BrickColor.new("Rust")
		Character:WaitForChild("RightUpperArm").BrickColor = BrickColor.new("Rust")
		Character:WaitForChild("LeftUpperArm").BrickColor = BrickColor.new("Rust")
		Type.Text = "3"
		end
	if SkinColorNumber.Value == 4 then
		Character:WaitForChild("Head").BrickColor = BrickColor.new("Reddish brown")
		Character:WaitForChild("RightUpperArm").BrickColor = BrickColor.new("Reddish brown")
		Character:WaitForChild("LeftUpperArm").BrickColor = BrickColor.new("Reddish brown")
		Type.Text = "4"
	end
	if SkinColorNumber.Value == 5 then
		Character:WaitForChild("Head").BrickColor = BrickColor.new("Bright yellow")
		Character:WaitForChild("RightUpperArm").BrickColor = BrickColor.new("Bright yellow")
		Character:WaitForChild("LeftUpperArm").BrickColor = BrickColor.new("Bright yellow")
		Type.Text = "5"
	end
	if SkinColorNumber.Value > 5 then
		SkinColorNumber.Value = 1
	end
	wait()
end

4 comments

0

Any errors? I would like to help!

0

And where is this script? It has a critical importance.

0

Attempt to index local 'Character' a nil Value are the errors and the script's parent is the frame of the gui

0

I found this explanation so it will be more understandable: If you manually created the Gui on the server and parented it to the PlayerGui, it’s server-side. If you create the Gui on the client, it’s clientside. If it’s in StarterGui, it’s clientside because the client locally clones the contents of StarterGui each time the character spawns.