GamerDeMTA Posted June 21, 2013 Share Posted June 21, 2013 how to make a Pickup with createPickup that is a Jetpack? and when u hit it it stays? I mean it doesn't disappear? **EDIT: and how to put the pickup you hit in the onClientPickupHit event? in the wiki examples it doesn't put it** Link to comment
PaiN^ Posted June 21, 2013 Share Posted June 21, 2013 createPickup Use the respawnTime argument to make it re-apper and create it client side so you can use onClientPickupHit event . Link to comment
GamerDeMTA Posted June 21, 2013 Author Share Posted June 21, 2013 the problem is!! onClientPickupHit Where do I put THE PICKUP which I need to HIT? It doesn't explain in the wiki! Link to comment
PaiN^ Posted June 21, 2013 Share Posted June 21, 2013 pickup = createPickup( ... ) addEventHandler( "onClientPickupHit", pickup, function( thePlayer, matchingDimension ) -- Your code end ) You mean like this ? Link to comment
Castillo Posted June 21, 2013 Share Posted June 21, 2013 -- server side: local myPickup = createPickup ( 0, 0, 5, 3, 370, 50, 1 ) addEventHandler ( "onPickupHit", myPickup, function ( hitElement ) if ( getElementType ( hitElement ) == "player" ) then -- If the element that hit it is a player. givePedJetPack ( myPickup ) -- Give him a jetpack end cancelEvent ( ) -- Cancel the event, so the pickup won't dissapear. end ) -- client side: local myPickup = createPickup ( 0, 0, 5, 3, 370, 50, 1 ) addEventHandler ( "onClientPickupHit", myPickup, function ( hitElement ) if ( getElementType ( hitElement ) == "player" ) then -- If the element that hit it is a player. outputChatBox ( "Hello there!" ) -- Output a message to the chat end cancelEvent ( ) -- Cancel the event, so the pickup won't dissapear. 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