Chaos Posted September 4, 2013 Posted September 4, 2013 (edited) client side: GUIEditor = { button = {}, window = {}, label = {} } addEventHandler("onClientResourceStart", resourceRoot, function() okno = guiCreateWindow(553, 303, 493, 466, "Skin System || Copyright by Ciastko", false) guiWindowSetSizable(okno, false) guiWindowSetMovable(okno, false) cj = guiCreateButton(36, 201, 126, 66, "CJ", false, okno) guiSetProperty(cj, "NormalTextColour", "FFAAAAAA") addEventHandler ( "onClientGUIClick", cj, cjj,false) end ) function gui() if (guiGetVisible (okno) == false) then guiSetVisible(okno, true) showCursor(true) else guiSetVisible(okno, false) showCursor(false) end end bindKey ("F2", "down", gui) function cjj() triggerServerEvent ("cj", getLocalPlayer()) end server side : addEvent ( "cj", true ) addEventHandler ( "cj", getRootElement(), function () local zombiekills = getElementData(source,"Zombie kills") if (zombiekills >= 20) then setElementModel ( source, 0) else outputChatBox ( "get level 2 first !", source, 255, 0, 0 ) end end ) well im trying to make when the player kills 20 zombies and more then he can select cj skin button but it's working only 1 time then if i change my skin and press the button again will not works Edited September 4, 2013 by Guest
Moderators IIYAMA Posted September 4, 2013 Moderators Posted September 4, 2013 may I ask what doesn't work? Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Chaos Posted September 4, 2013 Author Posted September 4, 2013 it's working but the problem it's working only 1 time then if i change my skin and press the button again will not works
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