1. Check out the Store if you're looking to Buy HL2RP or other schemas for your server. You can click Buy Schemas on the very top navigation bar to visit the store.
  2. Use the Plugin Center to easily subscribe to and auto-install Clockwork plugins to your server, or submit and share plugins you have developed.
  3. Having trouble setting up or developing with Clockwork? Check out the Wiki or post in the Support Forum for advice from fellow users.
Dismiss Notice
Hi Guest, you need a Steam account to register and post on these forums. Login with Steam at the top of the forums to get started!
Dismiss Notice
Hi Guest, do you want to buy HL2RP or another Clockwork schema? Visit the Cloud Sixteen Store to get started!

making physgun/toolgun invisible in observer mode

Discussion in 'Help' started by simulacra, Jan 23, 2018.

Thread Status:
Not open for further replies.
  1. i need to throw together a plugin that renders the physgun and toolgun completely invisible and silent when in observer mode. any ideas on how i'd accomplish this?
     
  2. Aspect

    Aspect Hey Pal, did you just blow in from stupid town? Active Member

    Impossible.
    I think.
     
    • Disagree Disagree x 1
  3. not impossible. i know nebulous has a plugin or something that does this and it's super useful for events and whatnot.
     
  4. vexus

    vexus ej rockwell's worst nightmare Clockwork Customer Active Member

    • Like Like x 1
  5. karl-police

    karl-police Hotrod turret Clockwork Customer Active Member

    I don't think but, does this help?

    weapons.Get("gmod_tool").ShootSound = Sound("");
     
    • Like Like x 1
    • Good Coder Good Coder x 1
  6. thanks karl
     
  7. karl-police

    karl-police Hotrod turret Clockwork Customer Active Member

    it worked?
     
  8. no clue. i was gonna play around with it later.
     
  9. sparkz

    sparkz FUCK! Clockwork Customer Active Member

    Managed to figure out how to achieve both effects relatively easily. I'll show my solutions for future reference.

    This is all done serverside! There is no need for an addon, though backups are obviously recommended.

    Toolgun: In the server, go to garrysmod/gamemodes/sandbox/entities/weapons/gmod_tool/shared.lua

    Sound: In the file, find SWEP.ShootSound = Sound( "Airboat.FireGunRevDown" ) and change it to SWEP.ShootSound = Sound( "" )
    (I didn't check if @karl-police's solution worked, sorry)

    Beam: In the same file, find the "function [​IMG] (image because of emoticons) line. Below it, delete these lines:
    local effectdata = EffectData()
    effectdata:SetOrigin( hitpos )
    effectdata:SetNormal( hitnormal )
    effectdata:SetEntity( entity )
    effectdata:SetAttachment( physbone )
    util.Effect( "selection_indicator", effectdata )

    local effectdata = EffectData()
    effectdata:SetOrigin( hitpos )
    effectdata:SetStart( self.Owner:GetShootPos() )
    effectdata:SetAttachment( 1 )
    effectdata:SetEntity( self )
    util.Effect( "ToolTracer", effectdata )
    The first line adds the ring that shows when you use the toolgun on something. You can keep it if you want, and it doesn't usually show on other peoples screens, but removing the second line is imperative as it removes the beam effect.

    Physgun: Hold C for the context menu, press the Player Model button and change Physgun color in the Colors tab to 0, 0, 0 as the RGB value. This seemingly works in combination with the toolgun edit (as I wasn't able to replicate this in singleplayer).
     
    • Winner Winner x 2
    • Like Like x 1
    Last edited: Feb 2, 2018
  10. sparkz my boy, you have the biggest brain
     

Previous Readers (Total: 0)

Thread Status:
Not open for further replies.