(((I'm a big noob to scripting, so bear with me.)))
I'm having trouble creating a skin color GUI for an avatar editor. What I want to do is have the player input a 0-255 value into 3 separate TextBoxes for R G and B values, then press a TextButton that fires a RemoteEvent which applies the color to the character via BodyColors.
I've tried a lot of things, and my most recent code iteration isn't showing any errors. However, it still isn't working.
It should bear mentioning that LoadCharacterAppearance is false, though enabling it doesn't seem to change anything.
Here's the Script i'm using, which is in ServerScriptService:
local textboxR = game.StarterGui.ScreenGui.Frame1.SkinColorR
local textboxG = game.StarterGui.ScreenGui.Frame1.SkinColorG
local textboxB = game.StarterGui.ScreenGui.Frame1.SkinColorB
textboxR.FocusLost:Connect(function()
rvalue = tonumber(textboxR.Text)/256
end)
textboxG.FocusLost:Connect(function()
gvalue = tonumber(textboxG.Text)/256
end)
textboxB.FocusLost:Connect(function()
bvalue = tonumber(textboxB.Text)/256
end)
function SetSkinColor(r, g, b)
local Button = game.StarterGui.ScreenGui.Frame1.TextButton
local char = game.Players.LocalPlayer.Character
local bodyColors = {'HeadColor3', 'Torso3', 'RightArmColor3', 'LeftArmColor3', 'RightLegColor3','LeftLegColor3'}
local bodyColor = Color3.new(r, g, b)
if (r > 1 or r < 0) or (g > 1 or g < 0)or (b > 1 or b < 0)
then
print("Color out of valid range!!!")
else
for _,color in pairs(bodyColors) do
char["Body Colors"][color] = Color3.new(r, g, b)
end
end
end
game.ReplicatedStorage.Events.SkinColor.OnServerEvent:Connect(rvalue, gvalue, bvalue)
and here is the LocalScript I have in the TextButton:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local SetSkinColorEvent = game.ReplicatedStorage.Events.SkinColor
local function SetSkinColor()
SetSkinColorEvent:FireServer()
end
game.StarterGui.ScreenGui.Frame1.TextButton.MouseButton1Click:Connect(SetSkinColor)
Any and all help would be appreciated, because I'm still new to this. Thanks in advance. :))

1 comment
Ok, I dealt with all the issues except the first one. Assuming I only want this to apply to the player who presses the button, what would I do for that? Would I have to split it up into both a Script and a LocalScript?