This is one of my bigger challenges, I have Never figured out how to make a Melee weapon. I've heard all you need to do is modify the Primary Fire option, but I don't know what to do, And I would very much appreciate it if anyone can help me out. Thanks in advance!
Here is my SWep code, if you need to see it: [url]https://pastebin.com/EtwRQXq6[/url]
[QUOTE=Shendow;52880465]Perform a trace with [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/util/TraceLine]util.TraceLine[/url] or [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/util/TraceHull]util.TraceHull[/url] and damage the hit entity (if it's valid!) with [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/TakeDamage]Entity:TakeDamage[/url] or [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/TakeDamageInfo]Entity:TakeDamageInfo[/url].[/QUOTE]
I, don't understand. Do I do those in the Primary Fire function? Or no?
Make sure you use [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Player/LagCompensation]Player:LagCompensation[/url] on the owner as well.
Alrighty, Thanks so much guys!
Sorry, you need to Log In to post a reply to this thread.