• Make a SWEP spawn with you (Singleplayer)
    3 replies, posted
Hello all! I need a way to make a SWEP spawn with me when I start a game or die (I need it only in singleplayer). I have an HL2 Beta weapons pack and somehow the hopwire thingy auto-spawns with me whenever I spawn. Can some kind soul help me do that to another? It's the 'Tele-Gun' from the 'Best of Toybox' addon ([URL="http://www.garrysmod.org/downloads/?a=view&id=129188"]link[/URL]) . Thanks! P.S.: Would this be considered "modifying" the SWEP? I want to know this if I have to contact the publisher (this would be ONLY for personal use). I don't want to upload it to garrysmod.org or Toybox. [highlight](User was banned for this post ("Wrong section" - Gran PC))[/highlight]
Why? Just hit Q and click the icon...
You don't need to modify the SWEP itself, all you're doing is, when the player spawns, you're triggering a timer that gives you the weapon. [code]function StripAndSet( ply ) ply:PrintMessage(HUD_PRINTTALK, "Hi. Just setting up yer guns.") ply:Give("weapon_telegun") --This is a big assumption on my part. You'll have to change this to match the folder name of the SWEP you want, and I really don't know if it'll work with Toybox. end function StripAndSetTimed( ply ) timer.Simple( 0.5, StripAndSet, ply ) end hook.Add("PlayerSpawn", "StrSetTime", StripAndSetTimed)[/code] And isn't this guy asking for help, Moo? Kind of mean to simply dodge the question and waste a reply.
[QUOTE=Killer_Steel;36132431] [code]function StripAndSet( ply ) ply:PrintMessage(HUD_PRINTTALK, "Hi. Just setting up yer guns.") ply:Give("weapon_telegun") --This is a big assumption on my part. You'll have to change this to match the folder name of the SWEP you want, and I really don't know if it'll work with Toybox. end function StripAndSetTimed( ply ) timer.Simple( 0.5, StripAndSet, ply ) end hook.Add("PlayerSpawn", "StrSetTime", StripAndSetTimed)[/code] [/QUOTE] For OP's sake. The code provided by Killer needs to go somewhere. If you are trying to make it gamemode specific, use the GM:PlayerLoadout hook instead. If you want this to run everytime, regardless of your gamemode in single player... add it to the autorun folder. You can name it anything in this case.
Sorry, you need to Log In to post a reply to this thread.