Jump to content

set weapon property


5150

Recommended Posts

ok so can someone help me? i want the katana to be a one-hit-kill (its a lightsaber mod) so when you hit someone, its an instant kill. i know the script must go in client.lua under "weapon window" in "freeroam" but idk how to make the script or edit the meta to include this. i looked at the wiki and it didnt help much. please someones help?

Link to comment

What is it that you don't understand? The wiki shows you the list of arguments that are passed to the even'ts handling function. One of those arguments is the weapon's id.

With that you can check when the player is damaged for the weapon's id, if it's the Katana, then immediately kill the player.

addEventHandler('onClientPlayerDamage', localPlayer, function(attacker, weapon) 
 if (weapon == 8 ) then 
  setElementHealth(localPlayer, 0) 
 end 
end) 

Link to comment
What is it that you don't understand? The wiki shows you the list of arguments that are passed to the even'ts handling function. One of those arguments is the weapon's id.

With that you can check when the player is damaged for the weapon's id, if it's the Katana, then immediately kill the player.

addEventHandler('onClientPlayerDamage', localPlayer, function(attacker, weapon) 
 if (weapon == 8 ) then 
  setElementHealth(localPlayer, 0) 
 end 
end) 

thanks bro, and just to be sure, you put this where i specified in the main post? and btw i think i downloaded your business system some time ago. still have it ;)

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...