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 ) I'll help When I Can.
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 '=' I'll help When I Can.
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 LUA Scripter [Tut]How to add maps using in-game script editor [Tut]How to get a hosted MTA Sa Server for free
boro Posted October 10, 2012 Author Posted October 10, 2012 still error SCRIPT ERROR: cheat/fistshot.lua:3: 'then' expected near '=' I'll help When I Can.
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) - Working on [php/HTML/Mysql/Lua/Java Scripts/Web Design/3D Modeling]
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 - Working on [php/HTML/Mysql/Lua/Java Scripts/Web Design/3D Modeling]
boro Posted October 10, 2012 Author Posted October 10, 2012 Big THX TwiX script is full functional.. I'll help When I Can.
TwiX! Posted October 10, 2012 Posted October 10, 2012 Big THX TwiX script is full functional.. you're welcome - Working on [php/HTML/Mysql/Lua/Java Scripts/Web Design/3D Modeling]
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