Jump to content

PickUp


Recommended Posts

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

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