Pointshop Weapons skins

Hey, i want put Weapon Skins in my Pointshop.
Like crowbar -> Lightsward or something like that.

So now my question, did anyone have a Pointshop Item code for this ?

You’d have to replace the crowbar with another SWEP using another model.

Also, if you want something custom done for you, pay a coder on http://coderhire.com instead.

What’s the gamemode?

I have a TTT Server with a Pointshop.

Try:


ITEM.Name = 'Sledgehammer' // change this to whatever name you want
ITEM.Price = 600 // change this to whatever price you want
ITEM.Model = 'models/weapons/w_sledgehammer.mdl' // change this to what shop 'icon' you want
ITEM.WeaponClass = 'weapon_zm_sledgehammer' //change this to name for item you want to replace the crowbar with
ITEM.SingleUse = false // makes it persist every time. This does sometimes bug out, a good suggestion would be to add more weapons before this weapon that work similar, may give a workaround to your issue.

function ITEM:OnEquip(ply)
ply:StripWeapon('weapon_zm_improvised')
	ply:Give(self.WeaponClass)
	ply:SelectWeapon(self.WeaponClass)
end

function ITEM:OnHolster(ply)
	ply:StripWeapon(self.WeaponClass)
	ply:Give('weapon_zm_improvised')
	ply:SelectWeapon('weapon_zm_improvised')
end

function ITEM:PlayerSpawn(ply)
        ply:StripWeapon('weapon_zm_improvised')
	ply:Give(self.WeaponClass)
        ply:SelectWeapon(self.WeaponClass)
end

Taken from: http://forum.facepunch.com/showthread.php?t=1286904&p=41388387&viewfull=1#post41388387

That’s only if they have a separate SWEP. What you should do is just set the model instead of having a separate SWEP for every skin.

I try it with this code.
I take a Katana SWEP and put the Crowbar code in it. Change the DMG a bit. But it dont work at the moment.
I will test it later. At the moment i am at work.

I have a little bug with the Pointshop Weapon Skins.
When i join the server, sometimes i have the Crowbar (Katana Skin) in my hand while i am spectating the round…



ITEM.Name = 'Sledgehammer'
ITEM.Price = 1500
ITEM.Model = 'models/weapons/w_sledgehammer.mdl'
ITEM.WeaponClass = 'weapon_zm_sledgehammer'

function ITEM:OnEquip(ply)
ply:StripWeapon('weapon_zm_improvised')
	if not ply:IsSpec() then
	ply:Give(self.WeaponClass)
	ply:SelectWeapon(self.WeaponClass)
end
end

function ITEM:OnHolster(ply)
	ply:StripWeapon(self.WeaponClass)
	if not ply:IsSpec() then
	ply:Give('weapon_zm_improvised')
	ply:SelectWeapon('weapon_zm_improvised')
end
end


Ok i use this code


ITEM.Name = 'Sledgehammer'
ITEM.Price = 1500
ITEM.Model = 'models/weapons/w_sledgehammer.mdl'
ITEM.WeaponClass = 'weapon_zm_sledgehammer'

function ITEM:OnEquip(ply)
ply:StripWeapon('weapon_zm_improvised')
	if not ply:IsSpec() then
	ply:Give(self.WeaponClass)
	ply:SelectWeapon(self.WeaponClass)
end
end

function ITEM:OnHolster(ply)
	ply:StripWeapon(self.WeaponClass)
	if not ply:IsSpec() then
	ply:Give('weapon_zm_improvised')
	ply:SelectWeapon('weapon_zm_improvised')
end
end

There are only one little problem left.
I have a Katana skin, and sometimes the weapon random switch to the katana…

Could probably just change the code in the crow bar to add something along the lines of

crowbar



if self.owner:PS_HasItem: ("crowbarnewtexture") then
SWEP.ViewModel			= "models/weapons/c_sledgehammer.mdl"
else
SWEP.ViewModel			= "models/weapons/c_crowbar.mdl"
end


Not actual code per say, just the work around type of idea. Hopefully you see where I’m getting at.

Or better yet if you have a lot of them
code of item



ITEM.WeaponClass = 'weapon_zm_sledgehammer'
function ITEM:OnEquip(ply)
CBarRep = Sledge
end

function ITEM:OnHolster(ply)
CBarRep = default
end


Again not actual code but hopefully you see where it’s heading.
You’d then have it reference to that
such that
SWEP.WorldModel = CBarRep
Etc.

That dont fix the random weapon change problem

Did nobody know how to fix this problem ?

Code_gs made a suggestion, but I am not sure how you’d do that. Try looking for a pre-draw hook for your SWEP it may be helpful. I am curious about how to do this and will try some things tonight.