AlfaMTA Posted April 7, 2014 Posted April 7, 2014 I'm trying to do a tazer system with silenced pistol then, I put it in serverside: function removeDamage () setWeaponProperty (23, "poor", "damage", 0) end addEventHandler ( "onResourceStart", resourceRoot, removeDamage ) But it doesn't work can anyone help me?? Thanks for all! - C#|VB|Pascal Programmer - Lua Script Beginner
Moderators IIYAMA Posted April 7, 2014 Moderators Posted April 7, 2014 clientside addEventHandler ( "onClientPlayerDamage",localPlayer, function ( attacker, weapon, bodypart) if weapon == 23 then cancelEvent() end end) Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
AlfaMTA Posted April 7, 2014 Author Posted April 7, 2014 clientside addEventHandler ( "onClientPlayerDamage",localPlayer, function ( attacker, weapon, bodypart) if weapon == 23 then cancelEvent() end end) Unfortunaly, it doesn't work for me! - C#|VB|Pascal Programmer - Lua Script Beginner
50p Posted April 7, 2014 Posted April 7, 2014 clientside addEventHandler ( "onClientPlayerDamage",localPlayer, function ( attacker, weapon, bodypart) if weapon == 23 then cancelEvent() end end) Unfortunaly, it doesn't work for me! Because it's client-side. - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
Noki Posted April 9, 2014 Posted April 9, 2014 By default, if undeclared in meta.xml, the script will become server-sided. So, you need to change it in meta.xml (add in type="client" />). Sometimes, you have to make things client side... It's just how it works.
AlfaMTA Posted April 9, 2014 Author Posted April 9, 2014 Sorry everyone!! Actually It's works, I did a mess with name of script and I forgot to save the script Thanks for all!! - C#|VB|Pascal Programmer - Lua Script Beginner
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