Created
December 20, 2020 23:45
-
-
Save marcogravbrot/a3a95855329289b8aa734a72cf7b149e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CreateConVar("rocketbullets", 0, {}, "Whether or not bullets should be rockets.") | |
hook.Add("EntityFireBullets", "Rocket bullets", function(ent, data) | |
if GetConVar("rocketbullets"):GetBool() then | |
local rocket = ents.Create("rpg_missile") | |
rocket:SetPos(data.Src + Vector(0, 0, 20)) | |
rocket:SetAngles((data.Dir + data.Spread):GetNormalized():Angle()) | |
rocket:SetOwner(data.Attacker) | |
rocket:Spawn() | |
rocket:SetVelocity(data.Dir * 20) | |
rocket:SetCollisionGroup(COLLISION_GROUP_DEBRIS) | |
return false | |
end | |
end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment