Garry's Mod

Garry's Mod

CS:GO Knives SWEPs
Alina_Spielt 2017 年 10 月 31 日 上午 6:49
Remove/change Knive from slot 7 ?? PLS HELP !!
I like the knifes A LOT but if I buy them in the Pointshop they're in slot 7, that's the slot for most Traitor items. You need to trow the knife away to make space for the traitor item. And my question is, how to get the knife on another slot or replace it with the crowbar.

this is in the "csgo_bayonet.lua" for e.g.
C:\...\csgo_knives_sweps-master\lua\weapons\csgo_bayonet.lua

if ( CLIENT ) then
SWEP.Slot = TTT and 6 or 2
SWEP.SlotPos = 0
end

I already tried to copy it under the code of the csgo_bayonet.lua in the pointshop folder.
C:\csgo_knives_sweps-master\lua\pointshop\items\weapons

ITEM.Name = 'Bayonet Knife'
ITEM.Price = 20000
ITEM.Model = 'models/weapons/w_csgo_bayonet.mdl'
ITEM.Skin = 0
ITEM.WeaponClass = 'csgo_bayonet'

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

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

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

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

if ( CLIENT ) then
SWEP.Slot = TTT and 6 or 2
SWEP.SlotPos = 0
end

like this. But it didn't work.
< >
正在显示第 1 - 1 条,共 1 条留言
xdshot  [开发者] 2017 年 10 月 31 日 上午 8:32 
In each knife lua:

> SWEP.Slot = TTT and 6 or 2

Instead 6 you type desired slot number, starting from 0. For ex. if you want it in slot 2, you type 1.
< >
正在显示第 1 - 1 条,共 1 条留言
每页显示数: 1530 50