AHSS Posted April 19, 2011 Share Posted April 19, 2011 i made a simple window and a simple botton the problem is that the bottong function happens when i press anywhere in the window(parent) code local guiadminwindow local SlapB function AdminPanel(key, keyState) guiadminwindow = guiCreateWindow(336,76,824,721,"Admin Panel",false) guiadminlabel = guiCreateLabel(424,28,344,60,"Admin Commands",false,guiadminwindow) SlapB = guiCreateButton(433,98,91,20,"Slap",false,guiadminwindow) addEventHandler("onClientGUIClick", SlapB, Slap) end i binded it in a key and when i click on the botton or anywhere on the windo(botton parent) it makes the same function why?? please help Link to comment
Castillo Posted April 19, 2011 Share Posted April 19, 2011 local guiadminwindow local SlapB function AdminPanel(key, keyState) guiadminwindow = guiCreateWindow(336,76,824,721,"Admin Panel",false) guiadminlabel = guiCreateLabel(424,28,344,60,"Admin Commands",false,guiadminwindow) SlapB = guiCreateButton(433,98,91,20,"Slap",false,guiadminwindow) addEventHandler("onClientGUIClick", SlapB, Slap, false) end Link to comment
AHSS Posted April 20, 2011 Author Share Posted April 20, 2011 it worked ty i got another problem i made this script: local guiRandomMSG local gResRoot = getResourceRootElement(getThisResource()) function createrandomgui() local sx, sy = guiGetScreenSize() guiRandomMSG = guiCreateWindow((2/1440) * sx,(880/900) * sy,(1437/1440) * sx,(48/900) * sy,"",false) end addEventHandler("onClientPlayerJoin", getRootElement(), createrandomgui) but it doesnt work i tried the same script with a command handler it worked but didnt work like that whats is the problem? Link to comment
Castillo Posted April 21, 2011 Share Posted April 21, 2011 local guiRandomMSG local gResRoot = getResourceRootElement(getThisResource()) function createrandomgui() local sx, sy = guiGetScreenSize() guiRandomMSG = guiCreateWindow((2/1440) * sx,(880/900) * sy,(1437/1440) * sx,(48/900) * sy,"",false) end addEventHandler("onClientResourceStart", gResRoot, createrandomgui) onClientPlayerJoin is triggered for any player BUT the player who just joined (THE CLIENT) 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