Garry's Mod

Garry's Mod

CS:GO Knives SWEPs
Red Apple 14 Jun, 2016 @ 1:02pm
Deathrun Pointshop
I made a lua file for the pointshop for deathrun.

ITEM.Name = 'Karambit'
ITEM.Price = 20000
ITEM.Model = 'models/weapons/w_csgo_karambit.mdl'
ITEM.WeaponClass = 'weapon_karambit'
ITEM.SingleUse = false

function ITEM:OnEquip(ply)
if ply:HasWeapon('weapon_mu_knife') then
ply:StripWeapon('weapon_mu_knife')
ply:Give(self.WeaponClass)
ply:SelectWeapon("weapon_rp_hands")
else
end

function ITEM:OnHolster(ply)

end

function ITEM:OnSell(ply)
ply:StripWeapon(self.WeaponClass)
end


Now, the problem is I can see the knife on the pointshop, I can buy/holster the knife but I don't seems to spawn the knife in hand. Can anyone help. Thank You.
< >
Showing 1-11 of 11 comments
xdshot  [developer] 14 Jun, 2016 @ 1:05pm 
ITEM.WeaponClass = 'weapon_karambit'
You use wrong weapon name. Grab one from there https://steamhost.cn/steamcommunity_com/workshop/filedetails/discussion/506283460/412448792364686950/
Red Apple 14 Jun, 2016 @ 1:07pm 
Oh, Ok Thnx
Red Apple 14 Jun, 2016 @ 2:37pm 
ok, this my new code but still same problem

ITEM.Name = 'Karambit'
ITEM.Price = 20000
ITEM.Model = 'models/weapons/w_csgo_karambit.mdl'
ITEM.WeaponClass = 'csgo_karambit'
ITEM.SingleUse = false

function ITEM:OnEquip(ply)
if ply:HasWeapon('csgo_karambit') then
ply:StripWeapon('csgo_karambit')
ply:Give(self.WeaponClass)
ply:SelectWeapon("weapon_rp_hands")
else

end
end

function ITEM:OnHolster(ply)

end

function ITEM:OnSell(ply)
ply:StripWeapon(self.WeaponClass)
end
Panda Collision 21 Jun, 2016 @ 8:43pm 
ITEM.Name = 'Karambit'
ITEM.Price = 22000
ITEM.Model = 'models/weapons/w_csgo_karambit.mdl'
ITEM.WeaponClass = 'csgo_karambit'
ITEM.SingleUse = false


function ITEM:OnBuy(ply)
ply:Give(self.WeaponClass)
ply:SelectWeapon(self.WeaponClass)
end

function ITEM:OnSell(ply)
ply:StripWeapon(self.WeaponClass)
end

function ITEM:OnEquip(ply)
ply:Give(self.WeaponClass)
ply:Give(self.WeaponClass)
end

function ITEM:OnHolster(ply)
ply:StripWeapon(self.WeaponClass)
end

local function PlayerLoadout( ply )
ply:Give(self.WeaponClass)
end


There u go, silly u
Red Apple 22 Jun, 2016 @ 3:59am 
Ok, now I can see the knife in the pointshop, can buy and sell knife, I also can see the knife in the hand but only problem is that I can't use, it doesn't have the animation or anything. I have also put the Server ConVars code on to the server config, don't know what the problem is
Last edited by Red Apple; 12 Jul, 2016 @ 5:50am
Zeo 28 Sep, 2016 @ 1:47pm 
the reason why it doesnt spawn it in for you its because your deathrun gamemode is ♥♥♥♥♥♥ try changing it and it should work thats what i did and i fixed it
xdshot  [developer] 28 Sep, 2016 @ 1:52pm 
I added pointshop entries while ago. Does it work for now?
Seapn 18 Oct, 2016 @ 4:23am 
So My problem is that I installed the addon to my server and all knifes got added to the pointshop. I have added one knife but thay are all working and purchable?
NoTreat 22 Jul, 2018 @ 3:37pm 
Originally posted by Panda Collision:
ITEM.Name = 'Karambit'
ITEM.Price = 22000
ITEM.Model = 'models/weapons/w_csgo_karambit.mdl'
ITEM.WeaponClass = 'csgo_karambit'
ITEM.SingleUse = false


function ITEM:OnBuy(ply)
ply:Give(self.WeaponClass)
ply:SelectWeapon(self.WeaponClass)
end

function ITEM:OnSell(ply)
ply:StripWeapon(self.WeaponClass)
end

function ITEM:OnEquip(ply)
ply:Give(self.WeaponClass)
ply:Give(self.WeaponClass)
end

function ITEM:OnHolster(ply)
ply:StripWeapon(self.WeaponClass)
end

local function PlayerLoadout( ply )
ply:Give(self.WeaponClass)
end

It doesnt show in my hand
Sync 17 Aug, 2018 @ 6:05pm 
if SERVER then
resource.AddWorkshop( "756555913" )
end
ITEM.Name = 'Karambit Knife | Fade'
ITEM.Price = 3000
ITEM.Model = 'models/weapons/w_csgo_karambit.mdl'
ITEM.WeaponClass = 'csgo_karambit_fade'
ITEM.SingleUse = false

function ITEM:OnBuy(ply)
ply:Give(self.WeaponClass)
ply:SelectWeapon(self.WeaponClass)
end

function ITEM:OnSell(ply)
ply:StripWeapon(self.WeaponClass)

end


THATS MINE^^
Sync 17 Aug, 2018 @ 6:10pm 
if SERVER then
resource.AddWorkshop( "756555913" )
end
ITEM.Name = 'Karambit Knife | Fade'
ITEM.Price = 3000
ITEM.Model = 'models/weapons/w_csgo_karambit.mdl'
ITEM.WeaponClass = 'csgo_karambit_fade'
ITEM.SingleUse = false

function ITEM:OnBuy(ply)
ply:Give(self.WeaponClass)
ply:SelectWeapon(self.WeaponClass)
end

function ITEM:OnSell(ply)
ply:StripWeapon(self.WeaponClass)

end


THATS MINE^^
< >
Showing 1-11 of 11 comments
Per page: 1530 50