Citrus

HELP WITH THIS SCRIPT error line please!!

Recommended Posts

I need help with this error that it throws me debugscript 3:

  -----   -       local elementSyncer = getElementSyncer(source)       -     ------

Here's the full function code!

function onClientPedLoseSyncer(thePed)
    if thePed then
        outputChatBox("Ya tienes un Perro!.")
    end
end
addEvent("onClientPedLoseSyncer", true) -- When a ped has no syncer anymore
addEventHandler("onClientPedLoseSyncer", getRootElement(), onClientPedLoseSyncer)

addEventHandler( "onClientElementStreamOut", getRootElement( ),
    function ( )
        --if getElementType(source == "ped") then -- Is a ped being stramed out?
            local elementSyncer = getElementSyncer(source) --- Error line!! : attempt to call global 'getElementSyncer'  (a nil value) ---
            
            if not elementSyncer then
                triggerClientEvent("onClientPedLoseSyncer", getRootElement(), source) -- Triggers 'onPedLoseSyncer' client-side (param1= ped that ran out of syncers)
                --triggerServerEvent("onPedLoseSyncer", getLocalPlayer(), source) -- Triggers 'onPedLoseSyncer' server-side (param1= ped that ran out of syncers)
            end
        --end
    end
)

What does it mean? Could you fix it ?? pleasE!!!.

Edited by Dutchman101

Share this post


Link to post
2 hours ago, Bonsai said:

Its a serverside function only.

And it is not serious?

attempt to call global 'getElementSyncer'  (a nil value)

FIX PLEASE!!!!!

Share this post


Link to post
7 minutes ago, Citrus said:

And it is not serious?

attempt to call global 'getElementSyncer'  (a nil value)

FIX PLEASE!!!!!

Basically you can't use it like that due your script is client-side.

Share this post


Link to post
On 30/3/2017 at 00:38, XeroxMTA said:

Basically you can't use it like that due your script is client-side.

No entiendo nada, hablas castellano?. Tiene o no solución? Porque ya me cansa ese error!. incluso pensaba en eliminar la línea porque nadie me adyua o dice como solucionarlo!.

Share this post


Link to post
6 hours ago, Citrus said:

No entiendo nada, hablas castellano?. Tiene o no solución? Porque ya me cansa ese error!. incluso pensaba en eliminar la línea porque nadie me adyua o dice como solucionarlo!.

Te recuerdo que tenemos la sección en castellano aqui, ésta es la sección general en la que solo se habla en inglés.

Xerox te ha indicado que no puedes usar esa función en la parte del server puesto que es una función que se ejecuta solo en el cliente, de ahí tu error.

Share this post


Link to post
Guest
This topic is now closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.