I've been trying for literally 3 hours now and i'm probably the stupidest person in this place right now but what am I doing wrong with this script???
local h = script.Parent.Parent.Parent.edit_label.Part.Value local d = game.Players.LocalPlayer.Data local c = script.color.Value local n = script.Parent.Name local head = script.Parent.Parent.Parent.Hat local torso = script.Parent.Parent.Parent.Torso local larm = script.Parent.Parent.Parent.Larm local rarm = script.Parent.Parent.Parent.Rarm local lleg = script.Parent.Parent.Parent.Lleg local rleg = script.Parent.Parent.Parent.Rleg script.Parent.MouseButton1Click:connect(function() if h == "head" then head.BackgroundColor3 = Color3.fromRGB(c) d.headcolor = n if h == "torso" then torso.BackgroundColor3 = Color3.fromRGB(c) d.torsocolor = n end end end)
this is a fraction of the script and it wont even work, but what it is supposed to do is check which part of the body the player is editing and if it is that part of the body to change that color, but every time I do this it will only change the head or change nothing.
if anyone can actually fix this I will praise you.
Now to fix the entire script, we would need you to produce the entire script. But for now, this should fix this element of the script.
local h = script.Parent.Parent.Parent.edit_label.Part.Value local d = game.Players.LocalPlayer.Data local c = script.color.Value local n = script.Parent.Name local head = script.Parent.Parent.Parent.Hat local torso = script.Parent.Parent.Parent.Torso local larm = script.Parent.Parent.Parent.Larm local rarm = script.Parent.Parent.Parent.Rarm local lleg = script.Parent.Parent.Parent.Lleg local rleg = script.Parent.Parent.Parent.Rleg script.Parent.MouseButton1Click:Connect(function() if h == "head" then head.BackgroundColor3 = Color3.fromRGB(c) d.headcolor = n elseif h == "torso" then torso.BackgroundColor3 = Color3.fromRGB(c) d.torsocolor = n end end)
Also don't use :connect, it's depreciated, use :Connect.