Knock Out Script.

How would i make it so that, if a player is hit by a certain weapon like “example_knife” and their health <40 then they ragdoll for 25 seconds. I’m not very good with lua, if you could make it, brilliant, but im just trying to learn.

Thanks!

https://scriptfodder.com/scripts/view/1525

Are you mental, im here to learn, not use terrible scripts.

Well they would be the teacher. Perhaps you can message them, and ask them to help you along. I use this script personally, and find it to be outstanding, with no errors. The creator of the script is the one you’ll want to talk to.

And how are you going to “learn” if you are asking us to make it for you?

If you’re here to learn - then here ya go: http://wiki.garrysmod.com/page/Main_Page - everything you need is on that site. Should take 10 minutes (allowing time to make a sandwich). You lost me at the point of calling scripts on SF terrible. A lot of the devs there put a lot of time and effort into their scripts. So it’s pretty ironic to ask for help, from most the same people who write those “terrible scripts”.

I have a feeling he will be making a lot of sandwiches, but that’s just me.

i only said the make it part because, the last time I did some one made it, then explained it step by step on how they did it, they showed me how to make lists and if statements. Also, that’s a DarkRP script, from what I can see it has a lot of DarkRP Varibles and would be deemed useless as it confuse me.

And in my defence, most of the facepunch community despise servers and people that use “Generic code hire scripts”. So I just learnt from you lot so don’t blame me, theirs a lot of good scripts yes, but still, it’s like blaming a rude child at a school for their behaviour which was brought on by their parents.

[editline]18th January 2016[/editline]

Your not even wrong, I don’t normally learn from reading. It’s like you have the choice, “read this 100 page book on how to make this or come watch the guys who made it and they’ll explain it to you.”

If you don’t learn from reading how do you intend to learn by people making the script for you?

“Terrible scripts”

Sounds ironic.

I’m not even using it on a server, I just want to know how I’d go about doing something like this, reading is not the best way of learning in my circumstances. I did not learn hammer through reading, I did not learn how to draw through reading, and I did not learn how to make 3D models and geometry from reading. I learned by watching others do it, then did it my self. so be it there’s no videos that I can find which assist me in this such project.

Use the http://wiki.garrysmod.com/page/GM/EntityTakeDamage hook and check if the entity is a player, check the health, create ragdoll on player position, hide the player, make a timer, unhide the player and remove the ragdoll.

That is very simply put and the lua gurus here probably have better methods but thats just an example.

Thank you, ill look into it, i guess :slight_smile:

I don’t get why the facepunch community is always so mean towards each other :v

prepares for “dumb” ratings

I agree, it’s a little to aggressive some times, so be it, it’s some times why people learn.

agression and rudeness only give birth to more agreesion and rudeness.
I don’t see why it’s so hard for people who think something is a piece of cake to help those who are just starting their journey into lua coding, instead of giving dumb ratings, posting snide comments, or linking to the main page of the wiki, which is more of a function library than a usage documentation (it doesn’t teach good programming habits).

I am pretty active on another programming help forums, and I don’t know how many times I’ve answered the same questions. Takes me a few minutes, but would have taken them hours or days to figure out.
I’ve noticed that when you help people and are friendly to them, they often show that same attitude to others on the forums… which kind of shows here on facepunch too. Lots of people become rude or snide, since that’s how they’re treated when asking for help.

I’ll point out how the attitudes of people vary between the sections of the site tho.

Imo, the help section is where people should be the friendliest, or simply stay away from the topic and let someone else answer it. Otherwise google results will mostly result in unsolved threads, which often seems to be the case here, and it can be frustrating.

At least OP seems to have gotten a descent suggestion of how to proceed :slight_smile:

Probably because this section of the site has a bunch of people asking for others to make them scripts, which isn’t really a “Developer Discussion”. If this section was named “Request A Script” or something similar to that then I would be more than happy to help out.

Also what soliv said is all you would need to do what you want done.

The problem with a “Developer Discussion” subforum is that you can’t really participate in any “discussions” until you’re more experienced.
I’m surprised there isn’t also a simpler “Programming/Lua Q & A” subforum, where people can post more basic questions without mixing the topics up with the more serious discussions.

btw, I agree that people shouldn’t just be asking for scripts, but personally I sometimes find it easier to answer a problem with a few lines of commented code than using English