Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function PANEL:EquipButton()
- local item = STORE_ITEMS[self:GetParent().CurItem]
- local itemType = item.Type
- local command
- local text
- if (itemType == "Hat") then
- command = "iv_changehat"
- elseif (itemType == "Trail") then
- command = "iv_changetrail"
- elseif (itemType == "Model") then
- command = "iv_changemodel"
- elseif (itemType == "Power-Up") then
- command = "iv_changepower"
- elseif (itemType == "Gesture") then
- text = "Use"
- command = "iv_usegesture"
- end
- local parent = self:GetParent()
- local parentparent = parent:GetParent()
- self.EquipButton = vgui.Create("DButton", self)
- self.EquipButton:SetSize(65, 22)
- self.EquipButton:SetPos(self:GetWide() - 75, 8)
- self.EquipButton:SetText(text or "Equip")
- self.EquipButton.DoClick = function()
- RunConsoleCommand(command, item.ID)
- if (item.Type == "Hat") then
- LocalPlayer():SetHat(item.Model)
- end
- if (parentparent) then
- parentparent.PlayerImage:SetModel(LocalPlayer():GetModel())
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement