Hello kind reader, i hope you have a great day!
I'm making my first steps to create a login panel, and I just started learning the Gui basics, but I'm failing to Export the Gui from client side.
Here is my script ( it's not complicated at all :
Client side :
local login = {};
function login_show()
login[1] = guiCreateWindow (0, 0, 0.5, 0.4, "Information", true);
login[2] = guiCreateTabPanel (0, 0.1, 1, 1, true, login[1]);
login[4] = guiCreateTab("Map Information", login[3]);
login[5] = guiCreateTab("Help", login[4]);
-- adds a label (text) to each tab
guiCreateLabel(0.02, 0.04, 0.94, 0.2, "This is information about the current map", true, login[4]);
guiCreateLabel(0.02, 0.04, 0.94, 0.92, "This is help text.", true, login[5]);
end;
addEvent("loginshow", true);
addEventHandler("loginshow", root, login_show);
function login_delete()
for i,k in ipairs(login) do
if login[i] then
guiSetVisible(login[i], false);
end;
end;
end;
addEvent("logindelete", true);
addEventHandler("logindelete", root, login_delete);
Serverside :
function LoginPanelShow()
TriggerClientEvent(Player, "loginshow");
end
function LoginPanelDelete()
TriggerClientEvent(Player, "logindelete");
end
addCommandHandler("test1", LoginPanelShow);
addCommandHandler("test2", LoginPanelDelete);
I greatly thank you for your attention!