[HELP] vRP spawn error

lua: jdoodle.lua:20: attempt to index a nil value (global ‘Citizen’)
stack traceback:
jdoodle.lua:20: in main chunk
[C]: in ?

Also my script:

local locatii_texte = {

[1] = {912.30139160156,-3078.4187011718,-97.123634338378,"Bine ai venit pe ~r~FplayT Romania ~bAdvanced ~p~Roleplay~w~!"},

[2] = {910.8662109375,-3087.2299804688,-97.123580932618,"De aici iti creezi ~b~identitatea ->"},

[3] = {905.14953613281,-3085.8337402344,-97.123641967773,"~b~Identitate"},

[4] = {907.64611816406,-3103.7265625,-97.123588562012,"Acest server este un server de tip ~r~Advanced Roleplat~w~!"},

[5] = {905.38836669922,-3116.3986816406,-97.123588562012,"Nu uita sa citesti ~r~regulamentul~w~!"},

[6] = {903.20251464844,-3131.416015625,-97.123588562012,"De aici te imbraci"},

[7] = {897.56262207031,-3127.9755859375,-97.123641967773,"~r~Imbracaminte"},

[8] = {897.14147949219,-3130.4792480469,-97.123641967773,"~Y~Imbracaminte"},

[9] = {896.32904052734,-3133.1164550781,-97.123641967773,"~b~Imbracaminte"},

[10] = {897.48126220704,-3163.005859375,-97.123588562012,"Apropiete de un checkpint pentru a merge in oras!~r~SPOR LA ROLEPLAY!"}

}

local locatii_teleportare_in_oras = {

{899.93933105468,-3169.1481933594,-97.123588562012},

{898.07537841796,-3168.7902832032,-97.123588562012},

{896.12536621094,-3168.4216308594,-97.123588562012},

{894.21881103516,-3167.857421875,-97.123588562012},

{892.84643554688,-3167.4467773438,-97.123588562012}

}

local Skript = Citizen.CreateThread

Skript(function()

local ticks = 1000

while true do

    Citizen.Wait(ticks)

local ped = PlayerPedId()

local pedcoords = GetEntityCoords(ped)

    

    for i,v in pairs(locatii_texte) do

        local dist = #(vector3(v[1],v[2],v[3]) - pedcoords)

        if GetDistanceBetweenCoords(902.6693725586,-3134.8303222656,-97.123626708984, pedcoords.x, pedcoords.y, pedcoords.z, true) < 90 then

            Draw3DText(pedcoords.x,pedcoords.y,pedcoords.z,"~r~FplayT MEMBER",0.1,6)

            

            DisableControlAction(0,21,false) 

            DisableControlAction(0,24,true) 

            DisableControlAction(0,25,true) 

            DisableControlAction(0,47,true) 

            DisableControlAction(0,203,true) 

            DisableControlAction(0,216,true) 

            DisableControlAction(0,255,true) 

            DisableControlAction(0,298,true) 

            DisableControlAction(0,321,true) 

            DisableControlAction(0,328,true) 

            DisableControlAction(0,18,true) 

            DisableControlAction(0,58,true) 

            DisableControlAction(0,263,true)

            DisableControlAction(0,264,true)

            DisableControlAction(0,257,true)

            DisableControlAction(0,140,true)

            DisableControlAction(0,141,true)

            DisableControlAction(0,142,true)

            DisableControlAction(0,143,true)

            DisableControlAction(0,22,false)

            if dist < 7.5 then

                ticks = 1

                Draw3DText(v[1],v[2],v[3],v[4],0.7)

            end

        end

    end

    for i,v in pairs(locatii_teleportare_in_oras) do

        dist = #(vector3(v[1],v[2],v[3]) - pedcoords)

        if dist < 7.5 then

            ticks = 1

            DrawMarker(42, v[1], v[2], v[3], 0, 0, 0, 0, 0, 0, 0.5, 0.5, 0.5, 200, 200, 200, 200, 0, 0, 0, 1, 0, 0, 0)

            if dist < 1.2 then

            SetEntityCoords(ped, 340.39419555664,-1090.509765625,30, 0, 0, 0, 0)

            SetEntityHealth(ped, 200)

            end

        end

    end

end

end)

function Draw3DText(x,y,z, text,scl,font)

local onScreen,_x,_y=World3dToScreen2d(x,y,z)

local px,py,pz=table.unpack(GetGameplayCamCoords())

local dist = GetDistanceBetweenCoords(px,py,pz, x,y,z, 1)



local scale = (1/dist)*scl

local fov = (1/GetGameplayCamFov())*100

local scale = scale*fov



if onScreen then

    if font ~= nil then

        font = font

    else

        font = 1

    end

    SetTextScale(1.0*scale, 2.1*scale)

    SetTextFont(font)

    SetTextProportional(1)

    SetTextColour(255, 255, 255, 255)

    SetTextDropshadow(0, 0, 0, 0, 255)

    SetTextEdge(2, 0, 0, 0, 150)

    SetTextDropShadow()

    SetTextOutline()

    SetTextEntry("STRING")

    SetTextCentre(1)

    AddTextComponentString(""..text)

    DrawText(_x,_y)

end

end

function drawtxt2d(msg, x, y)

SetTextFont(6)

SetTextProportional(0)

SetTextScale(0.6, 0.6)

SetTextColour(255, 255, 255, 255)

SetTextDropShadow(0, 0, 0, 0,255)

SetTextEdge(1, 0, 0, 0, 255)

SetTextCentre(1)

SetTextEntry("STRING")

AddTextComponentString(msg)

DrawText(x - 0.0/2, y - 0.0/2 + 0.005)

Wait(188888)

end

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.