Edit: Most of what I’ve written below the line is pretty much irrelevant now as I have learned a little more about the problem, however, sadly I still need help.
Basically the player models I’m trying to use in PointShop on my dedicated server have 3-4 body group submenu’s. The selections work fine in singleplayer but unfortunately don’t carry over into multiplayer. I had pretty much already accepted the fact that I wouldn’t be able to let people choose between all of the different leg/torso/hat options so decided to settle for 4 self-selected combinations. I thought I was being clever by finding the combinations by going into singleplayer, spawning a ragdoll and using command ‘ent_fire !picker setbodygroup #’ on them until I found a nice shirt/leg/hat combination to use on the server. Unfortunately that doesn’t seem to be the case at all and those numbers have nothing to do with the code I’m using (linked below in the original post).
The code I’ve been using, from what I have discovered so far, only allows me to modify one of the models sub menus. For example, I can only change a models hat, or torso, but not both, and I haven’t figured out how to actually select which one it changes. Changing the modifications.group for one model pack changes their hat, whilst doing it with another different model pack changes it’s torso even though the code is exactly the same. What I need help with is trying to figure out how to make it so that I can modify hats, torso, legs and whatever other bodygroup submenu is included with the models and then make them accessible from the PointShop interface. I really threw myself in at the deep end with this one I think. I hope I’m making sense. Does anyone know or have any ideas how I could solve this?
I’ve been trying to figure this one out for a while with no luck so I’m hoping someone here would be so kind as to offer some assistance. Basically I have just started fiddling about with bodygroups in PointShop on my dedicated server thanks to another member of Facepunch who posted this really handy code: http://forum.facepunch.com/showthread.php?t=1370552&p=44207601&viewfull=1#post44207601
[del]I’ll warn you in advance that this explanation might get overly confusing. So far I’ve managed to get it working problem-free with two model packs however there’s one in particular I’d like on the server that features a ton of torso, skin, leg and even glove options via bodygroups but for some reason just refuses to work with this code. I believe I have set it up correctly but unlike the other packs it seems to completely ignore my “modifications.group” numbers and instead forces the model to constantly wear the default bodygroup clothing. The bodygroup options I select in singleplayer do not carry over to multiplayer either. One of the two working model packs is similar to the broken one and actually uses some of the same hat models.
I managed to get the broken models to change bodygroup by going through a rather arduous process as follows:
- Join a singleplayer sandbox game
- Choose a player model from the broken pack that doesn’t change bodygroup in multiplayer
- Join my multiplayer server
- Open PointShop and equip a player model that I have added to the shop from the working pack
- Modify the bodygroup of said player model to, for example, 1 by using Eccid’s Derma_Query box
- Unequip working player model.
At this point it will have put me back into my broken model but instead of being in the default clothing that I joined in it is using the same bodygroup of the previous model that I just unequipped (aka it’s changing clothing). I could use this process to get the broken model that I want by setting the working model to whatever bodygroup number it is and then going through this process every time but obviously I’d rather figure out why it’s not working.[/del] Unfortunately I’m still very new to this so it’s not that easy. Does anyone have any ideas? I can post any code necessary if it would help but for now I’ll just include lua file of the broken model that refuses to change bodygroup:
ITEM.Name = 'Metro Male 1' ITEM.Price = 250 ITEM.Model = 'models/half-dead/metroll/a4b1.mdl', 'models/half-dead/metroll/c_arms_male1.mdl' function ITEM:OnEquip(ply, modifications) if not ply._OldModel then ply._OldModel = ply:GetModel() end timer.Simple(1, function() ply:SetModel(self.Model) ply:SetBodygroup(47, modifications.group or 0) end) end function ITEM:OnHolster(ply) if ply._OldModel then ply:SetModel(ply._OldModel) end end function ITEM:Modify(modifications) Derma_Query("Choose Bodygroup", "", "Outfit 1 No mask", function() modifications.group = 47 PS:SendModifications(self.ID, modifications) end, "Outfit 1 Gasmask", function() modifications.group = 119 PS:SendModifications(self.ID, modifications) end, "Outfit 2 No mask", function() modifications.group = 18 PS:SendModifications(self.ID, modifications) end, "Outfit 2 Gasmask", function() modifications.group = 90 PS:SendModifications(self.ID, modifications) end) print("modify") end function ITEM:OnModify(ply, modifications) self:OnHolster(ply) self:OnEquip(ply, modifications) end
[del]Some notes; I use this exact same code for a model in another pack and it works fine, and in order to find the modification group numbers I went into singleplayer and spammed the console command ‘ent_fire !picker setbodygroup #’ until I found clothing combinations that I wanted to use on the server. There is a lot of combinations so it took a while.[/del] Thanks in advance, I hope this was at least somewhat understandable.