Make a SWEP spawn with you (Singleplayer)

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 (link) . 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.


(User was banned for this post ("Wrong section" - Gran PC))

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.


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)

And isn’t this guy asking for help, Moo? Kind of mean to simply dodge the question and waste a reply.

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.