Pikachu Posted June 17, 2014 Posted June 17, 2014 function moveCrim(theAttacker, attackerWeapon) if getElementType(source) == "player" and getElementType(theAttacker) == "player" and (attackerWeapon == 33) then setElementFrozen(source, true) setTimer(function(source) setElementFrozen(source, false) end, 5000, 1) end end addEventHandler("onPlayerDamage", getRootElement(), moveCrim) WARNING: [gameplay]\NetGun\script.lua:5: Bad argument @ 'setElementFrozen' [Expected element at argument 1, got nil] Help me please
Et-win Posted June 17, 2014 Posted June 17, 2014 Source only works if you use it directly as the function gets runned, so with a timer, the source 'fades' away and then you can't use it anymore.
Pikachu Posted June 17, 2014 Author Posted June 17, 2014 Source only works if you use it directly as the function gets runned, so with a timer, the source 'fades' away and then you can't use it anymore. Is there a solution? This is the only problem I have, and REALLY need it fixed asap
TAPL Posted June 17, 2014 Posted June 17, 2014 function moveCrim(theAttacker, attackerWeapon) if theAttacker and getElementType(theAttacker) == "player" and (attackerWeapon == 33) then setElementFrozen(source, true) setTimer(function(source) setElementFrozen(source, false) end, 5000, 1, source) end end addEventHandler("onPlayerDamage", getRootElement(), moveCrim)
#DRAGON!FIRE Posted June 17, 2014 Posted June 17, 2014 addEventHandler( "onPlayerDamage", root, function( attacker, attackerWeapon ) if ( attacker and getElementType( attacker ) == "player" and attackerWeapon == 33 ) then setElementFrozen ( source, true ) setTimer( function( source ) setElementFrozen ( source, false ) end, 5000, 1, source ) end end )
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