Want to learn Lua

Can someone please recommend me guides for LUA for a beginner that has no prior experience in programming

1 Like

Below I will leave the link to everything I used when I started at fiveM

  1. Native functions for Notepad++
    [Dev Tool / Release] Lua Native Function Code Hints in Notepad++ (v3.0)

  2. fivem documentation
    https://wiki.fivem.net/wiki/Main_Page

  3. native references to .lua script
    https://runtime.fivem.net/doc/reference.html

  4. All color for script drawtext in lua
    [How to] Use colors in lua scripting

  5. This help you for create a basic script
    [How-To] Create a basic script

  6. VIDEOS
    https://www.youtube.com/watch?v=GVnIRt77ePk
    https://www.youtube.com/watch?v=S4eNl1rA1Ns
    https://www.youtube.com/watch?v=0LiaEDui2vE

So … this is it. Good luck and welcome.

12 Likes

http://holowczak.com/programming-concepts-tutorial-programmers/

Covers basics concepts of “programming”. Use the Lua documentation to find the equivalent of a concept

https://www.lua.org/docs.html

1 Like

Also once you actually get into scripting for FiveM this will be a life saver.

1 Like

Cheers guys @JinkLeft @Buggeroff @KiKoZl

1 Like

Or you can use this [Dev Tool / Release] Lua Native Function Code Hints in Notepad++ (v3.0) (my personal favorite)

I watched all the videos but it still doesnt really help. Does someone use some sort of studio to create scripts to help them or no? I wish someone would create a how to code in FiveM

1 Like

Well if you want to create scripts in C++/C# then yeah you’ll need Visual Studio. But if you just want to create Lua scripts then no you only need notepad (notepad++, brackets, atom, or any other text editor will do) and take scripts from these forums and mess around with them, get a local test server and see what you can make. The hardest part is actually coming up with ideas for new scripts, after that it’s just googling until you find what you need, piece by piece.

Well you obviously haven’t searched the forums then, there’s loads scattered across the forums but most can be found in #development:tutorials

can somone explain me the Register Event Handler,Event handler commands?

or can anyone explain me this code local spawnPos = vector3(686.245, 577.950, 130.461)

AddEventHandler(‘onClientGameTypeStart’, function()
exports.spawnmanager:setAutoSpawnCallback(function()
exports.spawnmanager:spawnPlayer({
x = spawnPos.x,
y = spawnPos.y,
z = spawnPos.z,
model = ‘a_m_m_skater_01’
}, function()
TriggerEvent(‘chat:addMessage’, {
args = { ‘Welcome to the party!~’ }
})
end)
end)

exports.spawnmanager:setAutoSpawn(true)
exports.spawnmanager:forceRespawn()

end)

How accurate is this since it was posted in 17?