FiveM Scripting #1 - First FiveM Script [LUA] [German]

Опубликовано: 20 Апрель 2026
на канале: CurryScripts
6,021
132

In this video series, I'll explain how you can learn FiveM Scripting in a simple and thoughtful way !

═════════════════════════════════════

Everything for the Client :

ESX = nil

Citizen.CreateThread(function()
while ESX == nil do
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
Citizen.Wait(0)
end
while ESX.GetPlayerData().job == nil do
Citizen.Wait(10)
end
PlayerData = ESX.GetPlayerData()
end)

RegisterNetEvent('esx:playerLoaded')
AddEventHandler('esx:playerLoaded', function(xPlayer)
ESX.PlayerData = xPlayer
end)

RegisterNetEvent('esx:setJob')
AddEventHandler('esx:setJob', function(job)
ESX.PlayerData.job = job
end)

local filename = function()
local str = debug.getinfo(2, "S").source:sub(2)
return str:match("^./(.).lua$") or str
end
print("^6[CLIENT - DEBUG] ^0: "..filename()..".lua gestartet");

═════════════════════════════════════

Everything for the Config :

local filename = function()
local str = debug.getinfo(2, "S").source:sub(2)
return str:match("^./(.).lua$") or str
end
print("^6[CONFIG - DEBUG] ^0: "..filename()..".lua gestartet");

═════════════════════════════════════

Everything for the Server :

ESX = nil

TriggerEvent("esx:getSharedObject", function(obj) ESX = obj end)

═════════════════════════════════════

Link to the LUA Docs : http://www.lua.org/manual/5.1/de/manu...

═════════════════════════════════════

Link to my Discord :   / discord  

═════════════════════════════════════

There is a lot of work going on in this series of videos so please also give me some feedback to improve some things