Hello, I renamed my PointShop Jump Pack item in the Accessories category "Jump Training" my question is, is there anyway to make the jump pack have no model while still function as a purchaseable "entity"? The reason I ask is so I can make this sort of like a player upgrade and so I can create more like "Speed Training"
Also would there be a way to replace the view in the PointShop with a .png file that I upload to the server? I tried ITEM.Icon but that obviously didn't work, here is the code:
[CODE]ITEM.Name = 'Jump Training'
ITEM.Price = 7500
ITEM.Model = 'models/xqm/jetengine.mdl'
ITEM.Bone = 'ValveBiped.Bip01_Spine2'
function ITEM:OnEquip(ply, modifications)
ply:PS_AddClientsideModel(self.ID)
end
function ITEM:OnHolster(ply)
ply:PS_RemoveClientsideModel(self.ID)
end
function ITEM:ModifyClientsideModel(ply, model, pos, ang)
model:SetModelScale(0.5, 0)
pos = pos + (ang:Right() * 7) + (ang:Forward() * 6)
return model, pos, ang
end
function ITEM:Think(ply, modifications)
if ply:KeyDown(IN_JUMP) then
ply:SetVelocity(ply:GetUp() * 6)
end
end[/CODE]
[QUOTE=Frubbs;44412428]Hello, I renamed my PointShop Jump Pack item in the Accessories category "Jump Training" my question is, is there anyway to make the jump pack have no model while still function as a purchaseable "entity"? The reason I ask is so I can make this sort of like a player upgrade and so I can create more like "Speed Training"
Also would there be a way to replace the view in the PointShop with a .png file that I upload to the server? I tried ITEM.Icon but that obviously didn't work, here is the code:
[CODE]ITEM.Name = 'Jump Training'
ITEM.Price = 7500
ITEM.Model = 'models/xqm/jetengine.mdl'
ITEM.Bone = 'ValveBiped.Bip01_Spine2'
function ITEM:OnEquip(ply, modifications)
ply:PS_AddClientsideModel(self.ID)
end
function ITEM:OnHolster(ply)
ply:PS_RemoveClientsideModel(self.ID)
end
function ITEM:ModifyClientsideModel(ply, model, pos, ang)
model:SetModelScale(0.5, 0)
pos = pos + (ang:Right() * 7) + (ang:Forward() * 6)
return model, pos, ang
end
function ITEM:Think(ply, modifications)
if ply:KeyDown(IN_JUMP) then
ply:SetVelocity(ply:GetUp() * 6)
end
end[/CODE][/QUOTE]
I think removing ModifyClientSideModel and OnEquip, OnHolster should work for the first one. As for the second one, you'd have to probably recode pointshop.
Actually, you can, by using Item.Material like so;
[code]ITEM.Material = 'FILEPATH/GOES/HERE.png'[/code]
It also works with vmt file extensions, I think.
In order to make your item invisible, just insert the following code into your PointShop item;
[code]function ITEM:ModifyClientsideModel(ply, model, pos, ang)
model:SetModelScale(1.6, 0)
model:SetMaterial('engine/occlusionproxy')
pos = pos + (ang:Forward() * -7) + (ang:Up() * 8)
ang:RotateAroundAxis(ang:Right(), 90)
return model, pos, ang
end
[/code]
You can change engine/occlusionproxy to a different material name to make it have a different material. The occlusionproxy material makes props invisible, so this'll work for your purposes. There are different ways to do this, but this is probably the easiest if you have no lua experience.
[code]
ITEM.Model = ''
[/code]
Would return no model? Or am I wrong? :V
[editline]1st April 2014[/editline]
[code]
ITEM.Model = ''
-- or (HumbleTm's solution)
function ITEM:OnEquip(ply, modifications)
return --ply:PS_AddClientsideModel(self.ID)
end
function ITEM:OnHolster(ply)
return --ply:PS_RemoveClientsideModel(self.ID)
end
function ITEM:ModifyClientsideModel(ply, model, pos, ang) // you actually don't need any of this if you aren't going to use a model
-- model:SetModelScale(0.5, 0)
-- pos = pos + (ang:Right() * 7) + (ang:Forward() * 6)
return
-- return model, pos, ang
end
function ITEM:Think(ply, modifications)
if ply:KeyDown(IN_JUMP) then
ply:SetVelocity(ply:GetUp() * 6)
end
end
[/code]
:V
[CODE]function ITEM:ModifyClientsideModel(ply, model, pos, ang)
model:SetModelScale(0.5, 0)
pos = pos + (ang:Right() * 7) + (ang:Forward() * 6)
return model, pos, ang
end[/CODE]
model:SetModelScale([B][I]0.5[/I][/B], 0)
Change it to 0 to remove the jetpack model from the playermodel.
Sorry, you need to Log In to post a reply to this thread.