FiveM Scripting 20 - Ragdoll Keybind

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] become a patreon gentleman today and receive a ton of perks including just school rose early access content private support channels code snippets and more join today at patreon.com slash fjs alright what is up guys my name is Xue from Java today I'm gonna be we're gonna be making a rag doll script that'll it'll be bind it to a key bind so if we press a button on our keyboard it'll ragdoll us the pet that you're playing as so this code will be in the description below like always um so yeah you can find that if you want to follow along like that so I'm gonna go to my resources folder and then rag doll I already made the folder name it's just ragdoll you know that's what I'm gonna call this resource so in here I'm gonna make two files called you know we've done this before underscore underscore resource lua i'll make this bigger and i'm also gonna have a file called client Lula yes that's what we're gonna do and then the resource down low or we're gonna want to do is creating the right client and there's no script client Lula just like that and then in the client on Lua what we're gonna want to do is for it to be able to listen for a key bind we have to put this inside of a thread so I'm gonna do citizen dot create thread and function and then I'm gonna click end here and then I'm gonna do a while this will be in a lot of true Luke I'm sure you do and when I do citizen wait so doesn't crash client and I'm gonna do so i'm gonna make we've done key listeners before where it listens for your key presses it's just if is control rest just like this in the same caps one which is the input group and then 73 is gonna be the x key like on your keyboard just like that that's what i said it as you can find the controls on docks dot five m-net I'll put the key behind in the description below if you want to change this key to something else yeah and then I'm gonna and I want to end the if statement and then now what we're gonna want to do is we're gonna be doing we're gonna make the pedal so the native fort is set pet to just like this rag doll and then the first the first parameter will be the peds that we get player head - 1 and the second parameter is the time it takes for the pet to get up after you have been rag doll so I'm gonna make it one second which is 1000 milliseconds you can make this lower it'll just you can see how that works but these two should be the same pretty sure and now they stiff this parameter right here is the type so the type of Ragno so they're I'm gonna put this right here so 0 zero is the zero when if we were to set this to zero this rag doll type would be a normal rag doll then the one is Falls with stiff leg slash body I'm just copying this from the documentation for this native sorry but to is narrow leg so this will be like a stumble and then three is a wide leg stumble which you can play around with usually then I'm just gonna go with the normal rag doll because that's like what the what it is but if you want to play around with these you can go ahead well there was only four types here if you want to play around with that you can so now once we did that the next parameters are just either true church or I'm just I'm just gonna these don't really matter it's just like this is what I have it as last one is it doesn't it doesn't matter I don't know what I'm thinking over right now I made this script a while back if it's yeah it doesn't matter you can set this to true true true or false false false the documentation just says do either true true false I was getting confused with different native my bed or you could do false false false but it honestly these last three parameters don't really matter apparently so that's pretty much it for the script I'm gonna go in game and show you how it works okay so now I'm in the server and you can see if I were to click X I just fall I'm holding her down right now now when I let go one second later it should pick back up pick myself back up felt I jumped in the middle of it I kind of just falls on the floor and I'm holding it down I let go you know get back up if I just press it I'll just fall down and then I'll get back up so yeah let's you can also mess with like the different types I'm just gonna do two and restart it which is stumble I get yet it'll kind of just look really weird I guess they don't fall for stumble I know you can but it just looks kind of weird I guess it just depends on whatever you know your preference so yeah that's that's pretty much it for this script you can mess up or you can mess around with whatever you want for this you know whatever type you on or whatever might like leaders bugging out right now so thank you guys for watching the video I appreciate it and yeah see ya
Info
Channel: Jeva
Views: 43,183
Rating: undefined out of 5
Keywords: Fivem, zua, fivem scripting, fivem coding, fivem lua, how to code, lua, gta v modding, gta v scripting, gta 5 scripting, gta 5 modding, fivem roleplay, fivem rp, fivem ragdoll, ragdoll, ragdoll physics, fivem roleplay gta 5, fivem ragdoll scripting
Id: hpJ43bUo5k8
Channel Id: undefined
Length: 6min 40sec (400 seconds)
Published: Fri Jan 10 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.