Jump to content

Button Visible


Bean666

Recommended Posts

hi guys, i want to fix a problem but i cant. because im bad with these functions , alright when i click the button , button disappears and shows a new one i added money restrictions in server.lua but when i click the button i dont have money . it says i dont have money yes. but it shows the another button . i dont know how to fix this. but ik ill use IF Functions i tried but it didnt work. help please. is there anyway with "if" functions to help with this.

Code:

   addEventHandler("onClientGUIClick",GUIEditor.button[3],function() 
        if ( source == GUIEditor.button[3]) then 
        guiSetVisible(GUIEditor.button[3], false) 
        guiSetVisible(GUIEditor.button[9], true) 
        triggerServerEvent("shotgunstd",getLocalPlayer())  
        end 
    end ) 
  

Link to comment

any problems with this? please help i tried this but it didnt work.

   addEventHandler("onClientGUIClick",GUIEditor.button[1],function() 
        if ( source == GUIEditor.button[1]) then 
        getPlayerMoney(source)  
        if (money > 2000) then   
        guiSetVisible(GUIEditor.button[7], true) 
        guiSetVisible(GUIEditor.button[1], false) 
        triggerServerEvent("m4std",getLocalPlayer())  
        end 
    end ) 
  

Link to comment
any problems with this? please help i tried this but it didnt work.
   addEventHandler("onClientGUIClick",GUIEditor.button[1],function() 
        if ( source == GUIEditor.button[1]) then 
        getPlayerMoney(source)  
        if (money > 2000) then   
        guiSetVisible(GUIEditor.button[7], true) 
        guiSetVisible(GUIEditor.button[1], false) 
        triggerServerEvent("m4std",getLocalPlayer())  
        end 
    end ) 
  

local money = getPlayerMoney(source)

Link to comment

this one didnt work.

   addEventHandler("onClientGUIClick",GUIEditor.button[1],function() 
        if ( source == GUIEditor.button[1]) then 
        local money = getPlayerMoney(source) 
        if (money > 2000) then   
        guiSetVisible(GUIEditor.button[7], true) 
        guiSetVisible(GUIEditor.button[1], false) 
        triggerServerEvent("m4std",getLocalPlayer())  
        end 
    end ) 
  

Link to comment
addEventHandler("onClientGUIClick", GUIEditor.button[1], 
function() 
    if source == GUIEditor.button[1] then 
        if getPlayerMoney() >= 2000 then   
            guiSetVisible(GUIEditor.button[7], true) 
            guiSetVisible(GUIEditor.button[1], false) 
            triggerServerEvent("m4std", localPlayer) 
        end 
    end  
end, false) 

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...