Electro88 Posted April 9, 2016 Share Posted April 9, 2016 Hello i have little problem i want any player 150 kill zombie unlock silenced weapon but give error. Please help me attempt to compare number with string addEvent("Silenced", true) addEventHandler("Silenced",root, function() local zombiekills = getElementData(source,"Zombie kills") if (zombiekills >= 150) then local PlayerMoney = getPlayerMoney(source) if ( PlayerMoney >= 300) then takePlayerMoney(source,300) giveWeapon ( source , 23,60 ) else outputChatBox ( "Bu silahi alamassınız çünkü levelniz yetmiyor.", source, 255, 0, 0 ) end end end ) Link to comment
Anubhav Posted April 9, 2016 Share Posted April 9, 2016 addEvent("Silenced", true) addEventHandler("Silenced",root, function() local zombiekills = tonumber(getElementData(source,"Zombie kills")) if (zombiekills >= 150) then local PlayerMoney = getPlayerMoney(source) if ( PlayerMoney >= 300) then takePlayerMoney(source,300) giveWeapon ( source , 23,60 ) else outputChatBox ( "Bu silahi alamassınız çünkü levelniz yetmiyor.", source, 255, 0, 0 ) end end end ) Link to comment
Electro88 Posted April 9, 2016 Author Share Posted April 9, 2016 thanks i have one more i how lock button ? i cant it GUIEditor.button[2] = guiCreateButton(10, 147, 77, 34, "Pistol\n300$:1 LVL", false, GUIEditor.window[1]) addEventHandler ("onResourceStart", getRootElement(), function(button, state, absoluteX, absoluteY) if ( source == GUIEditor.button[1] ) then guiSetVisible ( GUIEditor.window[1] , false) showCursor ( false ) elseif ( source == GUIEditor.button[2] ) then guiSetEnabled ( source,false ) end end) Link to comment
ma2med Posted April 9, 2016 Share Posted April 9, 2016 GUIEditor.button[2] = guiCreateButton(10, 147, 77, 34, "Pistol\n300$:1 LVL", false, GUIEditor.window[1]) addEventHandler ("onResourceStart", getRootElement(), function() guiSetVisible ( GUIEditor.window[1] , false) showCursor ( false ) guiSetEnabled ( GUIEditor.button[2],false ) end) Link to comment
Electro88 Posted April 9, 2016 Author Share Posted April 9, 2016 Not Working anyone help me ? Link to comment
undefined Posted April 10, 2016 Share Posted April 10, 2016 GUIEditor.button[2] = guiCreateButton(10, 147, 77, 34, "Pistol\n300$:1 LVL", false, GUIEditor.window[1]) addEventHandler("onClientGUIClick", guiRoot, function(button, state, absoluteX, absoluteY) if source == GUIEditor.button[1] then guiSetVisible(GUIEditor.window[1] , false) showCursor(false) elseif source == GUIEditor.button[2] then guiSetEnabled(source, false) end end) Link to comment
Anubhav Posted April 10, 2016 Share Posted April 10, 2016 thanks i have one more i how lock button ? i cant it GUIEditor.button[2] = guiCreateButton(10, 147, 77, 34, "Pistol\n300$:1 LVL", false, GUIEditor.window[1]) addEventHandler ("onClientGUIClick", getRootElement(), function(button, state, absoluteX, absoluteY) if ( source == GUIEditor.button[1] ) then guiSetVisible ( GUIEditor.window[1] , false) showCursor ( false ) elseif ( source == GUIEditor.button[2] ) then guiSetEnabled ( source,false ) end end) 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