- Joined
- Jun 26, 2020
- Messages
- 1,928
Hello, I'm trying something like this:
The thing is the function
Lua:
local data = nil
local t = CreateTrigger()
ForForce(GetPlayersAll(), function ()
BlzTriggerRegisterPlayerSyncEvent(t, GetEnumPlayer(), "focus", false)
end)
TriggerAddAction(t, function ()
data = BlzGetTriggerSyncData()
end)
---@param p any
---@return any
function GetSyncPlayerData(p)
if p == GetLocalPlayer() then
BlzSendSyncData("focus", <my data>)
end
return data
end
BlzSendSyncData
creates another thread, so the value data
is not set immediatly, so the function SyncData
always returns me the previous value instead of the current, I tried yield the function with the [Lua] - Precise Wait (GUI-friendly), but it didn't work, what can I do?