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. ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
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 ) To Contact Me at Skype : [email protected]
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