Garry's Mod

Garry's Mod

CS:GO Knives SWEPs
Red Apple 2016 年 6 月 14 日 下午 1:02
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.
< >
正在显示第 1 - 11 条,共 11 条留言
xdshot  [开发者] 2016 年 6 月 14 日 下午 1:05 
ITEM.WeaponClass = 'weapon_karambit'
You use wrong weapon name. Grab one from there https://psteamcommunity.yuanyoumao.com/workshop/filedetails/discussion/506283460/412448792364686950/
Red Apple 2016 年 6 月 14 日 下午 1:07 
Oh, Ok Thnx
Red Apple 2016 年 6 月 14 日 下午 2:37 
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 2016 年 6 月 21 日 下午 8:43 
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 2016 年 6 月 22 日 上午 3:59 
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
最后由 Red Apple 编辑于; 2016 年 7 月 12 日 上午 5:50
Zeo 2016 年 9 月 28 日 下午 1:47 
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  [开发者] 2016 年 9 月 28 日 下午 1:52 
I added pointshop entries while ago. Does it work for now?
Seapn 2016 年 10 月 18 日 上午 4:23 
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 2018 年 7 月 22 日 下午 3:37 
引用自 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 2018 年 8 月 17 日 下午 6:05 
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 2018 年 8 月 17 日 下午 6:10 
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^^
< >
正在显示第 1 - 11 条,共 11 条留言
每页显示数: 1530 50