Nicolas ECM Posted August 8, 2014 Share Posted August 8, 2014 Hi all, i have one query about as one object produce damage, help with the functions please. Link to comment
Max+ Posted August 8, 2014 Share Posted August 8, 2014 Hi all, i have one query about as one object produce damage, help with the functions please. Explain Better Please what do you want to do . Link to comment
Nicolas ECM Posted August 8, 2014 Author Share Posted August 8, 2014 I want to make an object created with createObject function can do damage to any player who touches the object. Link to comment
Max+ Posted August 8, 2014 Share Posted August 8, 2014 'Event' : [url=https://wiki.multitheftauto.com/wiki/OnClientObjectDamage]https://wiki.multitheftauto.com/wiki/On ... jectDamage[/url] setElementHealth --- to players if they damage the Object Link to comment
Max+ Posted August 9, 2014 Share Posted August 9, 2014 ---ClientSide addEventHandler ( 'onClientObjectDamage', root, function ( _, attacker ) if ( getElementType ( attacker ) == 'player' ) then setElementHealth ( attacker, getElementHealth(attacker) - 5 ) outputChatBox ( 'You Lost -2 Health For Damaging the Object', attacker, 255, 0 , 0 ) end end ) Link to comment
Nicolas ECM Posted August 9, 2014 Author Share Posted August 9, 2014 Id of object in serverside? local tiempo = 3500 addCommandHandler("doton",function( sourcePlayer ) if (getTickCount ( ) - tiempo > 5000) then outputChatBox("Doton Doryu Joheki",sourcePlayer,0,255,0,false) tiempo = getTickCount ( ) local x, y, z = getElementPosition ( sourcePlayer ) objeto = createObject ( 897, x, y, z - 8, 0, 90, 90 ) setTimer (destroyElement, 10000, 1, objeto) moveObject ( objeto, 8000, x, y - 8, z + 1 ) setPedAnimation( sourcePlayer , "freeweights", "gym_free_pickup", -1, true, false, false ) setTimer ( function ( ) setPedAnimation ( sourcePlayer ) end ,3000, 1 ) else outputChatBox("Debes esperar 5 segundos para poder utilizar este jutsu!",sourcePlayer,255,0,0,false) end end) this object should cause damage plis help. Link to comment
Max+ Posted August 9, 2014 Share Posted August 9, 2014 Id of object in serverside? local tiempo = 3500 addCommandHandler("doton",function( sourcePlayer ) if (getTickCount ( ) - tiempo > 5000) then outputChatBox("Doton Doryu Joheki",sourcePlayer,0,255,0,false) tiempo = getTickCount ( ) local x, y, z = getElementPosition ( sourcePlayer ) objeto = createObject ( 897, x, y, z - 8, 0, 90, 90 ) setTimer (destroyElement, 10000, 1, objeto) moveObject ( objeto, 8000, x, y - 8, z + 1 ) setPedAnimation( sourcePlayer , "freeweights", "gym_free_pickup", -1, true, false, false ) setTimer ( function ( ) setPedAnimation ( sourcePlayer ) end ,3000, 1 ) else outputChatBox("Debes esperar 5 segundos para poder utilizar este jutsu!",sourcePlayer,255,0,0,false) end end) this object should cause damage plis help. no my code if you try to damage the object then your health will be -2 every time you damage the object .. Link to comment
Nicolas ECM Posted August 9, 2014 Author Share Posted August 9, 2014 ah ok how do for the object that is created cause damage? Link to comment
Max+ Posted August 9, 2014 Share Posted August 9, 2014 ah ok how do for the object that is created cause damage? i really don't know how to make the object make damage , but i think my script does if you try to cause damage to object he will cause damage to you -5 health . 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