Editing a workshop file after extracting the .gma

I’m not really sure how to explain this but I’ll try. I have this addon that is setup to download via workshop when the client is joining the server. This weapon is Detective buyable only, so what I did was extract the .gma file, went in the lua and put this in:


SWEP.CanBuy={ROLE_TRAITOR,ROLE_DETECTIVE}

I uploaded the whole folder to gmod/addons

But back to in-game, the weapon was still only Detective buyable. What would I have to do to fix this and make it buyable for both? I thought adding


SWEP.CanBuy={ROLE_TRAITOR,ROLE_DETECTIVE}

would fix it.

What exactly did you change between those two bits there? also try this code


local allowedRoles = { 
	ROLE_TRAITOR = true,
	ROLE_DETECTIVE = true,
	ROLE_WHATEVER = true,
}

SWEP.CanBuy = allowedRoles

I didn’t change a thing, It’s as if the workshop addon is getting priority. The workshop is in my workshop.lua but I also added the weapon to gmod/addon to modify that. I’m not really sure how to explain it, I apologise for that. But I will try that code and let you know if anything happens.

Edit: sadly the code didn’t work. It’s still only for detectives.

I’ll try explaining things a bit better. I have the workshop id in my workshop.lua file in lua/autorun/server. I got the .gma file of it and extracted it, trying to edit the shared.lua file of this weapon. (This is a problem with any addon I want to modify that’s in the workshop as well as in gmod/addons

Workshop addons have priority iirc. Either use different file names and use weapons.Register to override the workshop version or remove the GMA from your workshop collection and only use the addon in legacy format.

I’ll try that, thank you for the information!