In my first server script (lets say server1.lua) in resource A I have added this line:
TriggerEvent(logs:getdiscordid', source)
In my second server script (server2.lua) in resource B I have created the following code:
AddEventHandler('logs:getdiscordid', function(source)
local src = source
for k, v in ipairs(GetPlayerIdentifiers(src)) do
if string.sub(v, 1, string.len("discord:")) == "discord:" then
discord = string.gsub(v, "discord:", "")
print(discord)
end
end
end)
This works, when I run the code from script A I get the discord id printed, however I want to use the discord ID that is printed from script B to be present in script A, where I trigger the server event.
How can I do that? I tried adding the code into an export in script B, but when I do that, I get an error that there is no such export in resource B.