• how do i replace a weapon ??
    5 replies, posted
hey guys, i'm new and i dont know how i can replace a weapon like the smg1 with another gun i downloaded that is a swep. is this even possible? but if you know the answer please say it :3 thnx already an grtz, TheGuyWithCandy :3
You can't. The HL2 weapons are hard coded into the engine.
so what youre saying is : if i am not a pro scripter/hacking god i wont be doing that anytime soon? and those weapons that ARE replaced is that just done by pro's then???
You heard the man, there are no replaced weapons, it's not hard to do, it's impossible.
if you have a custom weapon, it will be in the weapons tab. you click it, get it, and can use it
[lua]--This replaces the pistol with the deagle, everytime a player spawns local Replaced = "weapon_pistol" --The weapon you want replaced local Replacement = "weapon_deagle" --The replacement for the weapon local function ReplaceWeapons(ply) if SERVER then timer.Simple(0.05, function() if ply:HasWeapon (Replaced) then ply:StripWeapon (Replaced) ply:Give (Replacement) end end) end end hook.Add("PlayerLoadout", "Replace Weapons on Spawn", ReplaceWeapons)[/lua] Just wrote it, should be easy to use and easy to understand 0.05 seconds after a player spawns it checks wether or not the player has the weapon "weapon_pistol" (Needs to be delayed, because you don't have it instantly on spawn), and if so, gives the player "weapon_deagle". Do not remove the timer.
Sorry, you need to Log In to post a reply to this thread.