I’ve been filtering all search results to facepunch and I found one thread, but then I lost it (was open in Steam browser, closed Garry’s Mod) and haven’t been able to find it again.
Anyway, here’s this:
function ITEM:Modify(modifications) PS:ShowColorChooser(self, modifications) end
Which brings up a color chooser. That works fine, but it won’t work on hats, which was addressed in the thread I lost.
I was thinking a workaround would be to just have the color chooser on something that ISN’T a hat, but positioned to act as a hat anyway (if anyone knows what I mean).
The hat models (for TF2 hats) support the color chooser perfectly:
This code looked like a promising lead (by: http://forum.facepunch.com/showthread.php?t=1370552&p=45281750&viewfull=1#post45281750)
ITEM.Name = 'Player Paint' ITEM.Price = 2500 ITEM.Model = 'models/props_junk/metal_paintcan001a.mdl' ITEM.Attachment = 'eyes' function ITEM:OnEquip(ply, modifications) if modifications.color ~= nil then newcolor = modifications.color ply:SetPlayerColor(Vector( newcolor.r / 255, newcolor.g / 255, newcolor.b / 255)) end end function ITEM:OnHolster(ply) local colDefault = Color(255,255,255,255) ply:SetColor(colDefault) end function ITEM:Modify(modifications) PS:ShowColorChooser(self, modifications) end function ITEM:OnModify(ply, modifications) self:OnHolster(ply) self:OnEquip(ply, modifications) en
As-is, it edits the player model’s colorable regions. However, I have NO idea how to make it apply to anything OTHER than the player model.
Can anyone help out? Preferably a fix to work on the hats :^)
Honestly, I’ll take any pointers, theories or whatever. I feel so close, it’s frustrating!