Learn how to write optimized code!
table.insert
use tableName[#tableName+1] = data
if something ~= nil
use if something then
. This method checks for nil and/or false at the same timeGetPlayerPed(-1)
with PlayerPedId()
GetDistanceBetweenCoords
with lua math aka #(vector3 - vector3)