Garry's Mod

Garry's Mod

[SCP] Keycard System by Guthen
Guthen  [developer] 20 Jul, 2021 @ 1:02pm
[OUTDATED] How to edit my keycards model?
This article is outdated since the update of the 10th February 2022, you should now refers to the new article

I often see this question so I will respond it here, so anyone could have a correct response.

Legal Terms
As the SCP content's license says, you are in right to edit my addon as long as you don't discredit me.

Introduction
First of all, you need to download and extract my addon content into your game's addons folder, I recommand using that {LINK REMOVED} for extracting the addon. We will doing the changes in it, so when I mention a path, this is located from this folder. Also, remove the original version from your game (unsubscribe or disable it).

Of course, if your goal is to change the default model by a custom one, you will also have to have a ready-to-use model (I won't cover how to modelize and import a model in GMod).

Then restart your game and launch a multiplayer game (number of players doesn't matters).

Models and Skins
All the keycards
If you want to change the default keycard model (by default, will change every keycard), edit the path in lua/weapons/guthscp_keycard_base.lua located at line 39. The line is :
local model = "models/props/scp/keycard/keycard.mdl"

Individual keycard and skins
If you want to change the keycards model and/or skin individually, edit this code in the keycards files at lua/weapons/ (you'll have to remove the '--' at the start of the line you want to edit) :
--SWEP.ElementSkin = 0 --SWEP.ElementModel = "path/to/model.mdl"

Take note that changing the model here will override the default one located at the base file.

Positions and Angles
If you want to change the positions, you will have to edit this code in lua/weapons/guthscp_keycard_base.lua from line 40 to 79 (and especially the numbers in Vector and Angle) :
SWEP.VElements = { [model] = { type = "Model", model = model, bone = "ValveBiped.Bip01_R_Finger0", rel = "", -- here is what you want to edit pos = Vector(4, -1, -0.519), angle = Angle(-8.183, -10.52, -99.351), size = Vector(0.625, 0.625, 0.625), -- end of will color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 4, bodygroup = {} } } SWEP.WElements = { [model] = { type = "Model", model = model, bone = "ValveBiped.Bip01_R_Hand", rel = "", -- here is what you want to edit pos = Vector(4.5, 4, -1.558), angle = Angle(-3.507, -92.338, -59.611), size = Vector(0.755, 0.755, 0.755), -- end of will color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 4, bodygroup = {} } }

To see the changes, I recommand to you to give you a keycard and to tweak the values while you are holding the weapon. It will change automatically if the autorefresh is not disabled.


Once you are satisfied with the result, you can put the edited folder in your server's addons folder. Don't forget to remove the original version from your server.
Last edited by Guthen; 6 Mar, 2022 @ 4:27am