Hello! As of right now i am working on my own game with a custom model which will be fully customizable for the player, but i’m running into some problems already.
What do you want to achieve? I want to have a working skin colour script so players can customize the model with the desired skin colour.
What is the issue? Whenever i use a premade skin colour changer they don’t work entirely on the model. Either everything BUT the head or parts that are unions. (i created certain parts using normal and negative parts, for detail).
What solutions have you tried so far? I’ve tried disasembling unions, recolouring parts and then putting them back together but this does not work. I thought that the code could be adjusted to include unions/the specific parts of the model but as i have no coding experience i would not know how.
i want to make this game with the least amount of coding due to my skills but this is a basic i would really want to include…
Here are the assets i used, including their scripts:
function OnTouch(hit)
a = hit.Parent:FindFirstChild("Humanoid")
skiny = hit.Parent:FindFirstChild("Skin")
if (skiny == true) then return end
local skin = Instance.new("Skin")
skin.SkinColor = script.Parent.BrickColor
skin.Parent = hit.Parent
end
script.Parent.Touched:connect(OnTouch)
Credits go to AmiraQueen and Zdude73 for these models!
If there are any alternatives to these codes (like a morph select UI with all skin colours) i’d like to hear them!
function OnTouch(Hit)
Humanoid = Hit.Parent:FindFirstChild("Humanoid")
if Humanoid then
for i, Part in pairs(Humanoid.Parent:GetDescendants()) do
if Part:IsA("BasePart") then
Part.BrickColor = script.Parent.BrickColor
end
end
end
end
script.Parent.Touched:connect(OnTouch)
function OnTouch(Hit)
Humanoid = Hit.Parent:FindFirstChild("Humanoid")
if Humanoid then
for i, Part in pairs(Humanoid.Parent:GetDescendants()) do
if Part:IsA("BasePart") or Part:IsA("Part") or Part:IsA("MeshPart") then
Part.BrickColor = script.Parent.BrickColor
end
end
end
end
script.Parent.Touched:connect(OnTouch)
function OnTouch(Hit)
Humanoid = Hit.Parent:FindFirstChild("Humanoid")
if Humanoid then
for i, Part in pairs(Humanoid.Parent:GetDescendants()) do
if Part:IsA("BasePart") or Part:IsA("UnionOperation") then
Part.BrickColor = script.Parent.BrickColor
end
end
end
end
script.Parent.Touched:connect(OnTouch)
I don’t know if it’s any different but, try his code again but remove the other two conditions:
function OnTouch(Hit)
Humanoid = Hit.Parent:FindFirstChild("Humanoid")
if Humanoid then
for i, Part in pairs(Humanoid.Parent:GetDescendants()) do
if Part:IsA("BasePart") then
Part.BrickColor = script.Parent.BrickColor
end
end
end
end
script.Parent.Touched:connect(OnTouch)
Both Parts and MeshParts are BaseParts, so you need not to include those other two conditions.
function OnTouch(Hit)
Humanoid = Hit.Parent:FindFirstChild("Humanoid")
if Humanoid then
for i, Part in pairs(Humanoid.Parent:GetDescendants()) do
if Part:IsA("UnionOperation") then
Part.UsePartColor = true -- or just set this property manually to the parts and use the first code i had sent
Part.BrickColor = script.Parent.BrickColor
elseif Part:IsA("BasePart") then
Part.BrickColor = script.Parent.BrickColor
end
end
end
end
script.Parent.Touched:connect(OnTouch)