FiveM Scripting 1 - Create Your First FiveM Resource (Lua for beginners)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] what is it guys my name is Zoey from Jeddah today I'm gonna be showing you how to create your first flattened resource so I have this code that we were gonna make in the link in the description it's on github if you want it it'll be there and yeah so first what we're gonna do since we're gonna need creating Lua files and coding in there I want you to get a good coating editors of notepad notepad plus plus I highly recommend visual studio code it's like this is what I use and this is what I will use the video and also sub live Texas and also good recommendation I'll put both of these links in the description below for you guys to check out just get one of them so what we're gonna want to do is go to go to our server folders and we've you know created and modified in the past two episode so I'm just going to open that up oops and go to our c FX server data master click on resources we're gonna right click and click on you and we're gonna recall it we're gonna be creating our first resource so this resource is gonna be inside of a folder here so we're gonna call it help because we're creating a help command essentially so right here before we go ahead click on view and make sure you have file name extensions on just makes your life easier so right here we're gonna create the Lua files that we're going to need to create this resource so we're gonna need a underscore underscore that's to underscore by the way resource yes and then another file we're gonna call it out C and I'll tell you why we're doing that it's because I'm this is the help resource and then this is uh the C means client because it's good it's a client sided script essentially and it's just a good practice to put your files like these because it's good for error handling and in the future you'll probably see so I'm gonna open this up and it automatically opened up in vs code which is perfect so to actually start this off we're going to need a resource to manifest version unfortunately on the proper five I'm documentation the link was dead so I just have what I had before so what you're gonna I'll put this up with this free to copy the link in the description I'm just going to type in resource [Music] [Music] to stop in quotes you can paste I I have this copied I'll put this in the description below and yeah this is the resource table underscore underscore that's two underscores and then we're gonna make a client script i underscore script and that in here we're gonna type in help and so yeah that's basically how the five mm when it opens up and you see that that resources started this is what kind of declares what's going on there so let it open up the help see da lua and it's kind of its blank right now but let's start it off with actually creating the command here actually now before we do that we're gonna make a function that message messages the player so getting a little complicated but it's our function so that's how you create a fit I'll show you how you create a function in lua so just typing function the message of putting parameters later and just just so you can see how it works and then in here you have to end the function put it in here we're gonna do trigger event and then the event is chat message and then this accepts a lot of parameters so the prefix kind of so I'm just gonna call it server and you'll see what that does later and then on curly brackets and two five five comma zero comma zero which is red so this is RGB so this is what its gonna make this red and then comma and then text so this text isn't defined but we're gonna define it through the function and you'll see how this works when we actually make the command here so I like to put the live functions on the bottom as prefer good practices you can't do so let's actually register the command using your register command function and then we're gonna call this command up and this uses a function because when this is found you're going to execute it so I'll just gonna click enter here okay to end it and it falls here and then in here we can actually just use this function so let's have a message and then you can see that what is right here let's say if I change this to this will be outputted along with this and you'll see how that works but I want this to have a parameter so we can just constantly use it for our purposes so I'll just keep it text and that's text in quotes in here we can just type in like you guess your servers discord discord that you slash with a message function servers website and then you can just be like you guys server website it's it should be fine so now to actually make this startup during the process where your five M server starts up I'm gonna go back to our CFX server data master where it's server dot CFG is and remember in episode 2 where we configured our five M server we created a separate CFG for CFG file for our resources I'm gonna open that up and these are the core that complement so I'm gonna create a little comment here saying our resources and then our new resource is called help because that's what we named that folder so yeah we gonna make it start over oops and then that should start up help so let's start our server up and as you can see it started help we didn't get an error so I'm gonna open up fly them and show you how this command works so I'll be right back all right so we are in fun excuse me we are in 5m now so since our server is honor you know our main computers can play on Direct Connect type it in that or you can type in localhost you can see that our server comes up that we configured from the last episode so I'm just gonna click connect and let that join the server and so it looks like we joined in our server here sorry for the lag so now since our resources started for you can click on teeth oh I forgot to log into steam that's fine so far okay so we can do slash help and as you can see it does it does what we made it do so I'm gonna be showing you where is it right right here there's a health see we could change it to whatever we want and one should remember that out remember that server though the thing that's in red you can change that to whatever you want to say and then we can change just keep it simple say hi or let's call this second line you can just essentially keep making lines by on you know making a licen third there first and then restart the resource by typing in restart every starts it so if we type in slash up it says first line and second line and you can see that it says bots so hopefully you guys you know understand what's going on here and if you got up to this point congratulations to create your first five ever resource and I subscribed in the future we're gonna be going more in debt and we'll get into server server events and fun stuff like that's just subscribe and yeah have a good day guys
Info
Channel: Jeva
Views: 451,358
Rating: undefined out of 5
Keywords: fivem scripting, zua, fivem, fivem bot, fivem coding, fivem modding, gtav modding, fivem programming, wesleyfn, zuacp, discord, cfg, cfx, jeva, jevazua, jeva zua, JEVA, fivem rp, fivem bay area buggs, fivem anomaly, fivem pro, fivem roleplay, roleplay fivem
Id: 9eIYmRg5ZeQ
Channel Id: undefined
Length: 9min 3sec (543 seconds)
Published: Tue Nov 13 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.