boro Posted October 10, 2012 Share 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 ) Link to comment
Baseplate Posted October 10, 2012 Share 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 Link to comment
boro Posted October 10, 2012 Author Share Posted October 10, 2012 SCRIPT ERROR: cheat/fistshot.lua:5: 'then' expected near '=' Link to comment
ali Posted October 10, 2012 Share 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 Link to comment
boro Posted October 10, 2012 Author Share Posted October 10, 2012 still error SCRIPT ERROR: cheat/fistshot.lua:3: 'then' expected near '=' Link to comment
Baseplate Posted October 10, 2012 Share 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 Link to comment
TwiX! Posted October 10, 2012 Share 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) Link to comment
Baseplate Posted October 10, 2012 Share Posted October 10, 2012 TwiX you forgot "elseif" at line 4, your script will have few errors Link to comment
TwiX! Posted October 10, 2012 Share Posted October 10, 2012 TwiX you forgot "elseif" at line 4, your script will have few errors my script not will have errors Link to comment
boro Posted October 10, 2012 Author Share Posted October 10, 2012 Big THX TwiX script is full functional.. Link to comment
TwiX! Posted October 10, 2012 Share Posted October 10, 2012 Big THX TwiX script is full functional.. you're welcome Link to comment
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