I have this error and I already imported the script
-- Client Side
RegisterCommand('requestserver', function(s, args)
local result = TriggerServerCallback {
eventName = 'pmc-test:testingAwesomeCallback',
args = {'some', 'args', 'here'}
}
print('gotcha')
end)
-- Server Side
RegisterServerCallback {
eventName = 'pmc-test:testingAwesomeCallback',
eventCallback = function(source, ...)
-- your awesome code here!
return 'return something'
end
}
I tried to use provided examples (with no changes whatsoever) and I either receive nothing or errors.
Broken, unless OP fixes it, do not use.
Hi!
Mine is not working.
I canāt do anything in or after TriggerServerCallback.
Iāve tried synchronous and asynchronous methods, but it doesnāt work.
All the code before is working and so is the server-side code. Itās only on the client-side, after or inside the callback that it doesnāt work.
Iāve included the shared script in my manifest file. Iām also running the resource on the server (before the resource Iām trying to use it on).
Here is my code (note: this is not the entire code)
Client-side Script (note: iām only using one of the methods at once)
print("teste") -- it prints with no errors
-- Asynchronous Method
TriggerServerCallback {
eventName = "MyServerCallbackEvent", args = {},
callback = function(myVar)
print("inside the callback", myVar) -- doesn't work
end
}
-- Synchronous Method
local myVar = TriggerServerCallback {
eventName = "MyServerCallbackEvent", args = {}
}
print("after the callback", myVar) -- doesn't work
Server-side Script
RegisterServerCallback {
eventName = "MyServerCallbackEvent",
eventCallback = function(source, args)
local _src = source
local myVar = 1
print("server-side print", myVar) -- it print with no errors
return myVar
end
}
NOTE: No errors in server and client consoles!
I know Iām doing something wrong otherwise it shoud work fine. I just donāt know what or whereā¦
Thanks for reading!