boro Posted October 10, 2012 Posted October 10, 2012 Hi all I tried to make script cheat mega hit [iAVENJQ] script works but when I shoot from gun so player is dead to one shot why ? what is bad ? this is lua addEvent "onPlayerFistshot" addEventHandler("onPlayerDamage", getRootElement(), function (attacker, fist, bodypart, loss) if bodypart then local result = triggerEvent("onPlayerFistshot", source, attacker, fist, loss) if result == true then killPlayer(source, attacker, fist, bodypart) end end end )
Baseplate Posted October 10, 2012 Posted October 10, 2012 function kill (attacker, fist, bodypart, loss) local weapon = getPedWeapon(attacker) if weapon = 0 elseif bodypart then local result = triggerEvent("onPlayerFistshot", source, attacker, fist, loss) if result == true then killPed(source, attacker, 0, 3) end end end addEvent ("onPlayerFistshot", true) addEventHandler("onPlayerDamage", root, kill) Untested yet, check it out
boro Posted October 10, 2012 Author Posted October 10, 2012 SCRIPT ERROR: cheat/fistshot.lua:5: 'then' expected near '='
ali Posted October 10, 2012 Posted October 10, 2012 function kill (attacker, fist, bodypart, loss) local weapon = getPedWeapon(attacker) if weapon = 0 then elseif bodypart then local result = triggerEvent("onPlayerFistshot", source, attacker, fist, loss) if result == true then killPed(source, attacker, 0, 3) end end end addEvent ("onPlayerFistshot", true) addEventHandler("onPlayerDamage", root, kill) Untested also
boro Posted October 10, 2012 Author Posted October 10, 2012 still error SCRIPT ERROR: cheat/fistshot.lua:3: 'then' expected near '='
Baseplate Posted October 10, 2012 Posted October 10, 2012 function kill (attacker, fist, bodypart, loss) local weapon = getPedWeapon(attacker) if weapon == 0 then elseif bodypart then local result = triggerEvent("onPlayerFistshot", source, attacker, fist, loss) if result == true then killPed(source, attacker, 0, 3) end end end addEvent ("onPlayerFistshot", true) addEventHandler("onPlayerDamage", root, kill) Still untested
TwiX! Posted October 10, 2012 Posted October 10, 2012 function kill(attacker,fist,bodypart,loss) local weapon = getPedWeapon(attacker); if weapon == 0 then if bodypart then local result = triggerEvent("onPlayerFistshot",source,attacker,fist,loss); if result == true then killPed(source,attacker,0,3); end end end end addEvent("onPlayerFistshot",true) addEventHandler("onPlayerDamage",root,kill)
Baseplate Posted October 10, 2012 Posted October 10, 2012 TwiX you forgot "elseif" at line 4, your script will have few errors
TwiX! Posted October 10, 2012 Posted October 10, 2012 TwiX you forgot "elseif" at line 4, your script will have few errors my script not will have errors
TwiX! Posted October 10, 2012 Posted October 10, 2012 Big THX TwiX script is full functional.. you're welcome
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