Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ITEM.Name = '2B'
- ITEM.Price = 250
- ITEM.Model = 'models/kuma96/2b/2b_pm.mdl'
- ITEM.Description = "2B"
- 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) --Headband
- ply:SetBodygroup(2, modifications.group2 or 0) --Skirt
- ply:SetBodygroup(3, modifications.group3 or 0) --Virtuous Contract
- ply:SetBodygroup(4, modifications.group4 or 0) --Beastlord
- end)
- end
- function Derma_Query_Dropdown( strText, strTitle, ... )
- local Window = vgui.Create( "DFrame" )
- Window:SetTitle( strTitle or "Message Title (First Parameter)" )
- Window:SetDraggable( true )
- Window:ShowCloseButton( false )
- Window:SetBackgroundBlur( false )
- Window:SetDrawOnTop( true )
- local InnerPanel = vgui.Create( "DPanel", Window )
- InnerPanel:SetDrawBackground( false )
- local Text = vgui.Create( "DLabel", InnerPanel )
- Text:SetText( strText or "Message Text (Second Parameter)" )
- Text:SizeToContents()
- Text:SetContentAlignment( 5 )
- Text:SetTextColor( color_white )
- local ButtonPanel = vgui.Create( "DPanel", Window )
- ButtonPanel:SetTall( 50 )
- ButtonPanel:SetDrawBackground( false )
- local NumOptions = 0
- local ListBox = vgui.Create( "DComboBox", ButtonPanel )
- local k = 1
- while true do
- local Text = select( k, ... )
- if Text == nil then break end
- local Func = select( k+1, ... ) or function() end
- ListBox:AddChoice(Text, Func, k == 1)
- NumOptions = NumOptions + 1
- k = k + 2
- end
- ListBox:SetPos(5,25)
- ListBox:SetWide(100)
- ListBox:SetTall(20)
- ListBox.OnSelect = function(self, index, value, data)
- data()
- Window:Close();
- end
- local w, h = Text:GetSize()
- w = math.max( w, ButtonPanel:GetWide() )
- Window:SetSize( w + 50, h + 25 + 45 + 10 )
- Window:Center()
- InnerPanel:StretchToParent( 5, 25, 5, 45 )
- Text:SetPos(0,5)
- Text:CenterHorizontal()
- ButtonPanel:StretchToParent( 5, 25, 5, 5 )
- ListBox:SetWide(ButtonPanel:GetWide())
- ListBox:CenterHorizontal()
- ListBox:CenterVertical()
- Window:MakePopup()
- if ( NumOptions == 0 ) then
- Window:Close()
- Error( "Derma_Query: Created Query with no Options!?" )
- return nil
- end
- return Window
- end
- function ITEM:OnHolster(ply)
- if ply._OldModel then
- ply:SetModel(ply._OldModel)
- end
- end
- function ITEM:Modify(modifications)
- Derma_Query_Dropdown("Headband", "",
- "On", function()
- modifications.group1 = 0 -- Default Headband
- PS:SendModifications(self.ID, modifications) --Makes sure the pointshop knows to apply changes
- end,
- "Off", function()
- modifications.group1 = 1 -- No Headband
- PS:SendModifications(self.ID, modifications)
- end)
- Derma_Query_Dropdown("Choose Skirt", "",
- "Default Skirt", function()
- modifications.group2 = 0 -- Default Skirt
- PS:SendModifications(self.ID, modifications) --Makes sure the pointshop knows to apply changes
- end,
- "Broken Skirt", function()
- modifications.group2 = 1 -- Broken Skirt
- PS:SendModifications(self.ID, modifications)
- end,
- "No Skirt (Not Nude)", function()
- modifications.group2 = 2 -- No Skirt
- PS:SendModifications(self.ID, modifications)
- end)
- Derma_Query_Dropdown("Virtuous Contract", "",
- "Off", function()
- modifications.group3 = 0 -- Default Virtuous Contract Disabled
- PS:SendModifications(self.ID, modifications) --Makes sure the pointshop knows to apply changes
- end,
- "On", function()
- modifications.group3 = 1 -- Virtuous Contract
- PS:SendModifications(self.ID, modifications)
- end)
- Derma_Query_Dropdown("Beastlord", "",
- "Off", function()
- modifications.group4 = 0 -- Default Beastlord Disabled
- PS:SendModifications(self.ID, modifications) --Makes sure the pointshop knows to apply changes
- end,
- "On", function()
- modifications.group4 = 1 -- Beastlord enabled
- PS:SendModifications(self.ID, modifications)
- end)
- print("modify")
- end
- function ITEM:OnModify(ply, modifications)
- self:OnHolster(ply)
- self:OnEquip(ply, modifications) -- adds the item back again, with new mods
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement