Client Callback

Hi,
I’m struggling with a callback. Could someone help me ? I don’t see what’s wrong

server.lua :

TriggerClientEvent('blabla', source, '1+1=10', function(can)
		if can then
			print('Could')
		else
			print("Couldn't")
		end
	end)

client.lua :

RegisterNetEvent('blabla')
AddEventHandler('blabla', function(str, callback)
	print(str)
	callback(false)
end)
1 Like

You can’t do a callback over an event going from server to the client and back. It just needs to be a 2 way street of events. Trigger client event the trigger a server event back to the server from the client.

That’s a lot of back and forth :sweat_smile: I was hoping for something simpler
Anyway thank you !

I mean you can make something that kinda simulates it like ESX did but you need to write the code manually to make that simulate well.

You can TriggerServerEvent() from clientside.
Give some input, let the server does his job and TriggerClientEvent() from Serverside.

There you can give the Infos from server to the Client.

Thats the easiest way to communicate between server and client

You can take a look at this: