• Need help with making a SWEP
    3 replies, posted
Hey guys, I recently became an admin on a good gmod server and due to that I wanted to try to make new SWEPs to use on the server. The SWEP I wanted to make would be exactly like the fists SWEP, but when a player is hit, it ragdolls the player that is hit for about 12 seconds. Is this possible? I was looking through the fists lua file and saw where I believe you would make the client call the method to ragdoll, but I was clueless on how to actually call a method to ragdoll a player on the server, or if that was possible. Thanks for any help :downs:
The ragdoll should be handled server-side. I'd recommend spawning a prop_ragdoll instead of using the clientside ragdoll because it's impossible to know where it landed for when the player stands back up. Look at corpse.lua for how to manipulate the bone-positions so it makes them fall correctly.
Is it possible to call the ulx ragdoll command on a player when primaryAttack() is called? What would this look like in the lua file? Edit: This is a DarkRP server if that matters
I don't recommend ulx; it uses its own hook system which causes slow-downs ( unconfirmed rumor which was told ), it causes a lot of unnecessary game-breaking bugs by returning true/false/v in hooks when not required ( when adding a hook, only make the logic for the addition and return only for that specific case, don't use else return x; end or it'll cause bugs ). Anyway, I'm not familiar with how ULX does it, can you post the code?
Sorry, you need to Log In to post a reply to this thread.