Jump to content

[Ayuda]Como puedo arreglar esto?


Ryuto

Recommended Posts

Hola gente tenia pensado hacer un script que se teletransporte y pege un golpe y lo logre pero hay un pequeño error.

yo quiero que el golpe cause daño a los demas pero tambien me causa a mi.Como puedo hacer que les cause daño a los demas y no a mi.

espada = function(player,k,ks)

local x,y,z = getElementPosition(player)

local r = getPedRotation(player)

triggerClientEvent("CreateNinjaSound",root,player,"espada.mp3")

setElementPosition(player,x+math.sin(math.rad(-r))*6,y+math.cos(math.rad(-r))*6,z)

setPedAnimation(player,"SWORD", "sword_1", -1, false, true, false, false)

setElementHealth ( player, getElementHealth(player) - 20 )

end ,2000,1

addCommandHandler ("espada-combo", espada)

Muchas gracias por su atencion :D

Link to comment
espada = function(player,k,ks) 
local x,y,z = getElementPosition(player) 
local r = getPedRotation(player) 
triggerClientEvent("CreateNinjaSound",root,player,"espada.mp3") 
setElementPosition(player,x+math.sin(math.rad(-r))*6,y+math.cos(math.rad(-r))*6,z) 
setPedAnimation(player,"SWORD", "sword_1", -1, false, true, false, false) 
setElementHealth ( player, getElementHealth(player) - 20 ) 
end ,2000,1 
  
addCommandHandler ("espada-combo", espada) 

Según veo, este código le causaría daño exclusivamente a quien utilice el comando 'espada-combo'.

Link to comment
espada = function(player,k,ks) 
local x,y,z = getElementPosition(player) 
local r = getPedRotation(player) 
triggerClientEvent("CreateNinjaSound",root,player,"espada.mp3") 
setElementPosition(player,x+math.sin(math.rad(-r))*6,y+math.cos(math.rad(-r))*6,z) 
setPedAnimation(player,"SWORD", "sword_1", -1, false, true, false, false) 
setElementHealth ( player, getElementHealth(player) - 20 ) 
end ,2000,1 
  
addCommandHandler ("espada-combo", espada) 

Según veo, este código le causaría daño exclusivamente a quien utilice el comando 'espada-combo'.

Y no se puede arreglar o poner algun otro codigo?

Link to comment
  • Recently Browsing   0 members

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