When you click a button it fires a remote event and adds whatever skin colour you have selected in the colour picker gui
The issue is there’s 0 errors however it isn’t working. IT WORKS if i put it in a local script,but when i add a event so everyone can the skin tone it doesn’t work.
local rs = game.ReplicatedStorage
local event = rs.RemoteEvents.SkinTones
function OnClick()
local function playerg(character)
for _, player in pairs (game:GetService("Players"):GetPlayers()) do
if player.Character == character then
return player
end
local Skins = player.Parent:FindFirstChild("BodyColors")
if (Skins == true) then return end
local skin = Instance.new("BodyColors")
local color = player.PlayerGui["Skintone Changer"].Frame.Page.Frame.Color
skin.Parent = player.Character
skin.HeadColor = BrickColor.new(color.Preview.BackgroundColor3)
skin.LeftArmColor = BrickColor.new(color.Preview.BackgroundColor3)
skin.RightArmColor = BrickColor.new(color.Preview.BackgroundColor3)
skin.TorsoColor = BrickColor.new(color.Preview.BackgroundColor3)
skin.RightLegColor = BrickColor.new(color.Preview.BackgroundColor3)
skin.LeftLegColor = BrickColor.new(color.Preview.BackgroundColor3)
end
end
end
event.OnServerEvent:Connect(OnClick)
ABOVE is the script after it’s been fired
local rs = game.ReplicatedStorage.RemoteEvents
local event = rs.SkinTones
script.Parent.MouseButton1Click:Connect(function()
event:FireServer()
end)
Above is the button being clicked.