A Localscript I just wrote as an example:
local Player=game.Players.LocalPlayer
Player.PlayerGui.ScreenGui.NextColorTextButton.MouseButton1Down:Connect(function()
if Player.Character.Head.BrickColor==BrickColor.new'Black'then
Player.Character.Head.BrickColor=BrickColor.new'Brown'
elseif Player.Character.Head.BrickColor==BrickColor.new'Brown'then
Player.Character.Head.BrickColor=BrickColor.new'White'
elseif Player.Character.Head.BrickColor==BrickColor.new'White'then
Player.Character.Head.BrickColor=BrickColor.new'Black'
end
end)
Player.PlayerGui.ScreenGui.PreviousColorTextButton.MouseButton1Down:Connect(function()
if Player.Character.Head.BrickColor==BrickColor.new'Black'then
Player.Character.Head.BrickColor=BrickColor.new'White'
elseif Player.Character.Head.BrickColor==BrickColor.new'White'then
Player.Character.Head.BrickColor=BrickColor.new'Brown'
elseif Player.Character.Head.BrickColor==BrickColor.new'Brown'then
Player.Character.Head.BrickColor=BrickColor.new'Black'
end
end)
I do know a few things about scripting but I haven't figured out how to use tables correctly and now I do find them very useful in quite a few situations like this one. I have made a fine working character customization script without using tables but it's very long, confusing and it's hard to edit or work on it any further. I would be fine if someone would give me an explanation or any quick examples on how to use tables in this case. Anyways, thanks!
