dex. Posted November 5, 2017 Share Posted November 5, 2017 So. My question is, how to start scripting gui in client side to server side? Like only admins can open? TIps? Help? Lil tutorial? Link to comment
idarrr Posted November 5, 2017 Share Posted November 5, 2017 Using Event Handler, something like this Client Side function onGUIStartOpen () triggerServerEvent("onGUIStartOpenServer", localPlayer) end addCommandHandler("opengui", onGUIStartOpen) function openGUIPanel () -- Your code end addEvent("openGUIPanel", true) addEventHandler("openGUIPanel", root, openGUIPanel) Server Side function onGUIStartOpenServer () local username = getAccountName(getPlayerAccount(client)) if isObjectInACLGroup ("user."..username, aclGetGroup ( "Admin" ) ) then triggerClientEvent(client, "openGUIPanel", client) end end addEvent("onGUIStartOpenServer", true) addEventHandler("onGUIStartOpenServer", root, onGUIStartOpenServer) Link to comment
dex. Posted November 5, 2017 Author Share Posted November 5, 2017 Thank you very much my friend! Link to comment
idarrr Posted November 6, 2017 Share Posted November 6, 2017 21 hours ago, dex. said: Thank you very much my friend! Np dude Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now