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