Help with Bodygroups modification and Pointshop

So i’m trying to impliment an option to my pointshop as so the player can modify their player model’s bodygroups by clicking on the model once purchased, so far i managed to only impliment the modify option but when you click it nothing happens at all, i tried adding some strings but i’m just a rookie when it comes to lua coding, i thought this string


Entity:GetBodyGroups()

would make the bodygroup sellection menu pop up but i don’t know how to use it


ITEM.Name = 'kurisu'
ITEM.Price = 3500
ITEM.Model = 'models/player/shi/Kurisu_Shi.mdl'

function ITEM:OnEquip(ply, modifications)
	if not ply._OldModel then
		ply._OldModel = ply:GetModel()
	end
	
	timer.Simple(1, function() ply:SetModel(self.Model) end)
end

function ITEM:OnHolster(ply)
	if ply._OldModel then
		ply:SetModel(ply._OldModel)
	end
end




function ITEM:Modify(modifications)
	ply:GetBodyGroups
end

function ITEM:OnModify(ply, modifications)
   self:OnHolster(ply)
   self:OnEquip(ply, modifications)
end
function ITEM:PlayerSetModel(ply)
	ply:SetModel(self.Model)
end


This is the model on the shop i’m trying to impliment the modify option to


ITEM.Name = 'Text Hat'
ITEM.Price = 3000
ITEM.Model = 'models/extras/info_speech.mdl'
ITEM.NoPreview = true

local MaxTextLength = 32

function ITEM:PostPlayerDraw(ply, modifications, ply2)
	if not ply == ply2 then return end
	if not ply:Alive() then return end
	if ply.IsSpec and ply:IsSpec() then return end
	
	local offset = Vector(0, 0, 79)
	local ang = LocalPlayer():EyeAngles()
	local pos = ply:GetPos() + offset + ang:Up()
	
	ang:RotateAroundAxis(ang:Forward(), 90)
	ang:RotateAroundAxis(ang:Right(), 90)
	
	cam.Start3D2D(pos, Angle(0, ang.y, 90), 0.1)
		draw.DrawText(string.sub(modifications.text or ply:Nick(), 1, MaxTextLength), "PS_Heading", 2, 2, modifications.color or Color(255, 255, 255, 255), TEXT_ALIGN_CENTER)
	cam.End3D2D()
end

function ITEM:Modify(modifications)
	Derma_StringRequest("Text", "What text do you want your hat to say?", "", function(text)
		
		if string.find(text, "#") then
			text = string.gsub(text, "#", "")
		end
		
		modifications.text = string.sub(text, 1, MaxTextLength)
		PS:ShowColorChooser(self, modifications)
	end)
end



I took some inspiration from this item on the shop since it had the modify option and all but i have yet to get the bodygroup menu popping up
Pls hulp my brain is toasting up
Thanks in advance

You need to draw a derma panel and create a function for ITEM:Modify(modifications) that lists all of the body groups you’d like. After which you’d need to run the ITEM.OnModify function again to refresh the player’s model.

Example:


function ITEM:OnEquip(ply, modifications)
            if not ply._OldModel then
                    ply._OldModel = ply:GetModel()
            end
            timer.Simple(2, function() ply:SetupHands()
                    ply:SetModel(self.Model)
                    --ply:SetSkin(1)
                    ply:SetBodygroup(1, modifications.group1 or 0) 
                    -- If needed set up more bodygroups here 
            end)                                             
    end
     
           
     
        function derma( )
         
                -- Do derma stuff here
         
        end
     
    function ITEM:OnHolster(ply)
            if ply._OldModel then
                    ply:SetModel(ply._OldModel)
            end
    end
     
    function ITEM:Modify(modifications)
            derma("Choose Dude", "",
                            "Dude1", function()
                                    modifications.group1 = 0 -- Default Dude
                                    PS:SendModifications(self.ID, modifications) --Makes sure the pointshop knows to apply changes
                            end,
                            "Dude2", function()
                                    modifications.group1 = 1 
                                    PS:SendModifications(self.ID, modifications)
                            end,
                            "Dude3", function()
                                    modifications.group1 = 10 
                                    PS:SendModifications(self.ID, modifications)
                            end)
                            --print("Body Groups Changed")
           
    end
     
    function ITEM:OnModify(ply, modifications)
       self:OnHolster(ply)
       self:OnEquip(ply, modifications) -- adds the item back again, with new mods
    end

Thanks for the reply though but, the thing is, i want this whole window to pop up when i press the “modify” button, but only with the bodygroups tab, because i have seen it in a server before but i have yet to manage implimenting it.

Thanks again in advance

Ummm i could really use a help over here
Thanks

Please T_T

http://forum.facepunch.com/showthread.php?t=1549323&p=51706486&viewfull=1#post51706486

You got every information you need.

You will need a server side function to receive user messages sent by the client, you are sending a string to the client, which is the model’s location.

The server side will receive ‘model’ and then run the function to change the model.
The client will feature a derma panel, and it’s up to you here, but you must then send the string containing the models location to the server, for the model to be changed.

That’s how I’d do it at least.