Garry's Mod

Garry's Mod

Rp_City17 - Build 210
FOR PEOPLE HAVING ISSUES WITH OPENING COMBINE DOORS IN DARKRP CLICK HERE
For those who wish to use this in DarkRP and don't want to set sv_cheats 1
Do the following,
*If you already have the DarkRP Modification add-on, good for you. If not, Why? I suggest you get it here, https://github.com/FPtje/darkrpmodification
*Ok, cool you either have the addon already or you just installed it. go to your addons folder, then "darkrpmodification\lua\darkrp_modules"
*Make a folder and call it something simple like "combinedooropen" (that's how mine is)
*Make a text file inside that folder and make sure to rename the extension to .lua
*The file you put here has to be prefixed with "sv_". Mine is called sv_combinedooropen.lua
*Inside the lua file, drop this code.
-----------------------------------------COPY UNDER THIS LINE--------------------------------------
function KeyPressedUse (ply, key)
if key == IN_USE then
local t = {}
t.start = ply:GetPos()
t.endpos = ply:GetShootPos() + ply:GetAimVector() * 100
t.filter = ply
local trace = util.TraceLine(t)
if trace.Entity and trace.Entity:IsValid() and (trace.Entity:GetClass() == "func_door" or trace.Entity:GetClass() == "prop_door_rotating" or trace.Entity:GetClass() == "prop_dynamic") then
trace.Entity:Fire("Open")
end
end
end
hook.Add( "KeyPress", "KeyPressedUse", KeyPressedUse )
------------------------YOU DON'T COPY THIS LINE OR ANYTHING UNDER IT.---------------------------
save your lua file and restart your server. Boom, you can now own and open combine doors.