Jump to content

[HELP]Object to do damage


Recommended Posts

---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

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
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

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...