Jump to content

Question


Centauro

Recommended Posts

Hello today i have a question, and i hope that you can asnwer this

my question is: i could pass arguments of a event, example the arguments of a "onClientWeaponFire" to a new event executed?

i want pass the arguments of event "onClientWeaponFire" for a new function executed with other event

anyone can help me please ?

thx

Link to comment

You can do it by passing in a variable number of arguments.

addEventHandler( "onClientWeaponFire", root, 
    function( ... ) 
        triggerEvent( "eventName", source, ... ) 
    end 
) 
  
addEvent( "eventName", true ) 
addEventHandler( "eventName", root, 
    function( ... ) 
        local hitElement, posX, posY, posZ, normalX, normalY, normalZ, materialType, lighting, pieceHit = unpack( { ... } ) 
    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...