[Solved] Geenlit for client invocation

Hi,
i m doing some stuff about a futur release but i m blocked to one point :

“A client tried to send an event of type CheckForVeh”, but it was not greenlit for client invocation. You may need to call RegisterServerEvent from your script"

Can someone explain this please.

In my client.lua

function blabla(button)
if blablabla then
TriggerServerEvent(‘CheckForVeh’,button.action)
end
end

In my server.lua

RegisterServerEvent(‘CheckForVeh’)
AddEventHandler(‘CheckForVeh’, function(vehicle)
blablablabal
blabablabla
end)

1 Like

In your client.lua the line before
TriggerServerevent(yourFunction)
add
registerNetEvent(yourFunction)

1 Like

yes i already did it with and without but not working

so i fixed it myself, i was doing a very very noob error, just missing to add in the __resource.lua : server_script

shame… u_u

1 Like

Could you explain that a tad more? what did you add in the _resourse?