oldnag Posted October 3, 2013 Share Posted October 3, 2013 ok hereis the code and when i click the close button nothing happens -- show the interface function showMiningUI ( ) miningUI = guiCreateWindow(773, 426, 399, 205, "Mining", false) guiWindowSetSizable(miningUI, false) guiSetVisible (miningUI,false) guiSetAlpha(miningUI, 1.00) guiSetProperty(miningUI, "CaptionColour", "FF2FFF00") bStartMining = guiCreateButton(11, 121, 376, 66, "Start Mining", false, miningUI) bCancelMining = guiCreateButton(359, 26, 18, 15, "x", false, miningUI) guiSetProperty(bStartMining, "NormalTextColour", "FF2FFF00") guiSetProperty(bMiningCancel, "NormalTextColour", "FFFD0102") helpText = guiCreateLabel(10, 31, 362, 112, "To start mining just click the button below and wait until your \ncharacter stops gathering to do it again. To abort current task \njust click on the \"x\" at the top right of the UI", false, miningUI) addEventHandler("onClientGUIClick", bStartmining, startMining) addEventHandler("onClientGUIClick", bcancelMining, cancelMining) end showMiningUI ( ) addEvent('showMiningUI',true) addEventHandler ( 'showMiningUI',root, function ( ) guiSetVisible (miningUI,true) end ) -- close button function cancelMining(button, state) if (source==bCancelMining) and (button=="left") and (state=="up") then guiSetInputEnabled(false) destroyElement(miningUI) miningUI, bCancelMining, bStartMining = nil, nil, nil removeEventHandler("onClientGUIClick", getRootElement(), cancelMining) end end Link to comment
Discord Moderators Zango Posted October 3, 2013 Discord Moderators Share Posted October 3, 2013 Small typo on line 19. (bcancelMining) It's useful to use the debug console, as this would yield a warning. You have a typo on line 13 as well. bMiningCancel. Line 18 bStartmining Happy scripting 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