[B]I need help putting CSGO knives into my gmod DEATHRUN server (Lua files, textures etc)[/B]

I recently created a gmod server but I could not add CSGO Knives into my server.

I don’t want to just add them to my server I want to add them to the pointshop.

The only problem is that I have no idea what i’m doing. I have added them in but for

some reason I can’t equip them. they also have pink and black squares as the texture(I know that means that the texture is missing or something like that).

I need someone to help me put them into the pointshop because I have no idea.

Here is the link to the addon that I am trying to add to pointshop: http://steamcommunity.com/sharedfiles/filedetails/?id=756555913&searchtext=csgo+knives

Any help would be much appreciated.

The “purple and black squares” indicate a missing texture. All clients need to download the required content of the ‘CSGO Knives’ addon. Since it’s already on the workshop, you can use this:

resource.AddWorkshop

As for adding the knives to your pointshop, post the code you are using for one of the items

so one of the knives that I am using is the karambit fade:

ITEM.Name = ‘Karambit Knife | Fade’
ITEM.Price = 0
ITEM.Model = ‘models/weapons/w_csgo_karambit.mdl’
ITEM.WeaponClass = ‘csgo_karambit_fade’
ITEM.SingleUse = true

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

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

[editline]10th January 2017[/editline]

Also where do I add the resource.AddWorkshop line of code? do I just add it to the lua file of the Karambit?

Please use [lua] tags around any code.

resource.AddWorkshop needs to be serverside, so you could do that in the item file. Just do an…

[lua]if SERVER then codehere end[/lua]

Did you really try to bold your title to get more attention?

[lua]test[/lua]

[editline]10th January 2017[/editline]

[lua]if SERVER then
ITEM.Name = ‘Karambit Knife | Fade’
ITEM.Price = 0
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)

resource.AddWorkshop( “756555913” )
end
[/lua]

so there is the code but now the item is not in the pointshop so I am so confused

[editline]10th January 2017[/editline]

please ignore the top part that says “test” that is not actually part of the code

[editline]10th January 2017[/editline]

no I just thought that is how you do it since I am new so I don’t know much about this website



function ITEM:OnSell(ply)
	ply:StripWeapon(self.WeaponClass)
        resource.AddWorkshop( "756555913" )
end


So you only add the needed resource when someone sells the item?

Wait I think you are going to have to evaluate the question

You are “making” (although it won’t work) download knife content when you sell the knife
Put resource.AddWorkshop at top of the file between SERVER condition, otherwise it will throw an error on client since resource.AddWorkshop doesn’t exists on client

Oh ok

[editline]10th January 2017[/editline]

Now there is another problem… the knife will not even appear in the pointshop.

Please can you explain why this is happening and also tell me the solution.

[editline]10th January 2017[/editline]

The new code is
[lua]if SERVER then
resource.AddWorkshop( “756555913” )
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[/lua]

You’re missing an end after the first if statement…

[lua]
if SERVER then
resource.AddWorkshop( “756555913” )
end
[/lua]

Why putting this custom addon instead of mine original?

The better question is why was your addon re-uploaded, you should get it taken down (imo).
(and if someone says it’s for server content, then why re-upload it 1, and 2 why not make it unlisted)

I usually don’t restrict re-uploading my addon, because not all are fine with my configuration. Some would love to cut some features to reduce size, for example. So I let them to re-upload for their needs. The only thing needed is to left credits.

I asking because they probably broke some things. And mine already has Pointshop entries for those knives, so ideally it should already support.