golanu21 Posted July 20, 2013 Share Posted July 20, 2013 if ( killer and getElementType(killer) == "player" and HOW I TYPE HERE ) then local progress = guiProgressBarGetProgress(bar) guiProgressBarSetProgress(bar, progress +1) addEventHandler("onClientPedWasted", how i tYpe here, onWasted) i want, when i kill a zombie to give me progress +1 Link to comment
Castillo Posted July 20, 2013 Share Posted July 20, 2013 You must use the event: onZombieWasted then you must trigger to the client side, with: triggerClientEvent Link to comment
golanu21 Posted July 21, 2013 Author Share Posted July 21, 2013 oh, i need your resource ?: '"exp_system " Link to comment
Jaysds1 Posted July 21, 2013 Share Posted July 21, 2013 Look at what he said: You must use the event: onZombieWasted then you must trigger to the client side, with: triggerClientEvent Link to comment
golanu21 Posted July 21, 2013 Author Share Posted July 21, 2013 i make that server side addEvent ( "onZombieWasted", true ) addEventHandler ( "onZombieWasted", root, function ( theKiller ) exports.exp_system:addPlayerEXP ( theKiller, 1) triggerClientEvent(theKiller, "gret", getRootElement()) end ) client side addEventHandler("onClientResourceStart", resourceRoot, function() fereastra = guiCreateWindow(1497, 317, 327, 67, "Experience", false) guiWindowSetSizable(fereastra, false) prog = guiCreateProgressBar(9, 16, 308, 41, false, fereastra) end ) function greetingHandler ( message ) guiProgressBarSetProgress(progressBar, prog +1) end addEvent( "gret", true ) addEventHandler( "gret", getRootElement(), greetingHandler ) and when i kill a zombie : client.lua:11 attempt to perform arhimetic on global "prog" (a userdata value) Link to comment
Castillo Posted July 21, 2013 Share Posted July 21, 2013 addEventHandler("onClientResourceStart", resourceRoot, function() fereastra = guiCreateWindow(1497, 317, 327, 67, "Experience", false) guiWindowSetSizable(fereastra, false) progressBar = guiCreateProgressBar(9, 16, 308, 41, false, fereastra) end ) function greetingHandler ( ) guiProgressBarSetProgress ( progressBar, ( guiProgressBarGetProgress ( progressBar ) + 1 ) ) end addEvent ( "gret", true ) addEventHandler ( "gret", getRootElement(), greetingHandler ) 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