I want to start scripting for my server.
But it desn’t seem like there is much infor on how.
So I’m asking all of you if you know a good way to start?
I want to start scripting for my server.
But it desn’t seem like there is much infor on how.
So I’m asking all of you if you know a good way to start?
Scammer did a reasonable tutorial to start.
From there you should go onto trail and error by making small things… here and there.
I did this but it seems like there is a lot of important information missing.
I am totally new to lua scripting so I don’t really understand what everything does
Personally, I am self-taught. If you do it enough, you will get the hang of it. Try editing a few of other peoples scripts, be sure not to release them though.
Okay I can try - Would you maybe be able to review some scripting if I post it in here?
Like @Atexx said. Download scripts you like and research what functions they ran
I can try my best to make sure they are right. The best way to test a script without getting in game and running it is using what I call a LUA tester.
Something like
https://www.lua.org/demo.html
Just copy and paste your script in there and it will tell you if somthing is wrong.
Hope you can help me with this:
I downloaded a script where I need some of it for what I am looking for.
Here is some of it (customized<for my script):
TriggerEvent('es:addCommand', 'addItem', function(source, args, user)
TriggerEvent("chatMessage", "", { 255, 255, 255 }, "Item added!")
end)
From what I understand is: whenever a player types /addItem in chat, the server prints a message saying “Item Added!” in white. (correct me if I’m wrong)
What I don’t understand is the function(source, args, user)
part.
What does source, args and user mean?