Jump to content

Script Question


KillerNico

Recommended Posts

Hi all

I want to make a GUI:

addEventHandler("onClientResourceStart",resourceRoot, 
    function() 
        GUIEditor_Window = {} 
        GUIEditor_Button = {} 
  
        GUIEditor_Window[1] = guiCreateWindow(782,176,240,493,"Alarm Menu",false) 
guiWindowSetMovable(GUIEditor_Window[1],false) 
guiWindowSetSizable(GUIEditor_Window[1],false) 
        GUIEditor_Button[1] = guiCreateButton(108,210,5,5,"",false,GUIEditor_Window[1]) 
        GUIEditor_Button[2] = guiCreateButton(22,56,196,55,"Stufe 5",false,GUIEditor_Window[1]) 
        GUIEditor_Button[3] = guiCreateButton(22,128,198,56,"Stufe 4",false,GUIEditor_Window[1]) 
        GUIEditor_Button[4] = guiCreateButton(23,201,197,55,"Stufe 3",false,GUIEditor_Window[1]) 
        GUIEditor_Button[5] = guiCreateButton(22,274,198,56,"Stufe 2",false,GUIEditor_Window[1]) 
        GUIEditor_Button[6] = guiCreateButton(22,344,199,57,"Stufe 1",false,GUIEditor_Window[1]) 
        GUIEditor_Button[7] = guiCreateButton(131,425,87,38,"Abbruch",false,GUIEditor_Window[1]) 
        GUIEditor_Button[8] = guiCreateButton(24,425,86,38,"Info (Chatbox)",false,GUIEditor_Window[1]) 
    end 
) 

So how i can add functions to the Buttons ??

Link to comment
        GUIEditor_Window = {} 
        GUIEditor_Button = {} 
  
        GUIEditor_Window[1] = guiCreateWindow(782,176,240,493,"Alarm Menu",false) 
        guiWindowSetMovable(GUIEditor_Window[1],false) 
        guiWindowSetSizable(GUIEditor_Window[1],false) 
        GUIEditor_Button[1] = guiCreateButton(108,210,5,5,"",false,GUIEditor_Window[1]) 
        GUIEditor_Button[2] = guiCreateButton(22,56,196,55,"Stufe 5",false,GUIEditor_Window[1]) 
        GUIEditor_Button[3] = guiCreateButton(22,128,198,56,"Stufe 4",false,GUIEditor_Window[1]) 
        GUIEditor_Button[4] = guiCreateButton(23,201,197,55,"Stufe 3",false,GUIEditor_Window[1]) 
        GUIEditor_Button[5] = guiCreateButton(22,274,198,56,"Stufe 2",false,GUIEditor_Window[1]) 
        GUIEditor_Button[6] = guiCreateButton(22,344,199,57,"Stufe 1",false,GUIEditor_Window[1]) 
        GUIEditor_Button[7] = guiCreateButton(131,425,87,38,"Abbruch",false,GUIEditor_Window[1]) 
        GUIEditor_Button[8] = guiCreateButton(24,425,86,38,"Info (Chatbox)",false,GUIEditor_Window[1]) 
  
function buttonClicks() 
if (source == GUIEditor_Button[1]) then 
outputChatBox("You have pressed the button 1") 
elseif (source == GUIEditor_Button[2]) then 
outputChatBox("You have pressed the button 2") 
  end 
end 
addEventHandler("onClientGUIClick",getRootElement(),buttonClicks) 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...