Hello everyone!
What would be the best solution:
1. Create a GUI outside the general function, hide the element, for example, "window", and show it using another function
2. Create a function with a GUI in it, and show it using this function itself
And will I be able to manage GUi elements in the second case?
First example:
local window = guiCreateWindow (...)
local window_element = guiCreateLabel (...) -- window is a parent
local other_window_element = guiCreateLabel (...) -- window is a parent
guiSetVisible (window, false)
function someFunction ()
guiSetVisible (window, true)
showCursor (true)
end
addEvent ("eventFromServer", true)
addEventHandler ("eventFromServer", localPlayer, someFunction)
Second example:
function someFunction ()
showCursor (true)
window = guiCreateWindow (...)
window_element = guiCreateLabel (...) -- window is a parent
other_window_element = guiCreateLabel (...) -- window is a parent
end
addEvent ("eventFromServer", true)
addEventHandler ("eventFromServer", localPlayer, someFunction)
Thank you.