Jump to content

no afectar al jugador, pero si alos que estan cerca


MYSOTO

Recommended Posts

    for i, thePlayer in ipairs ( getElementsByType( "player" ) ) do    
        if ( sasori ~= thePlayer ) then
               local px, py, pz = getElementPosition( thePlayer )
              local tx, ty, tz = getElementPosition( player )
              if ( getDistanceBetweenPoints3D( px, py, pz, tx, ty, tz ) <= 50 ) then
                setElementHealth( thePlayer, ( getElementHealth( sasori ) - 80 ) 
            end
        end
    end

 

Hola tengo ese pequeño script pero quiero que le quite vida a los que están cerca del jugador pero no al jugador porfa tengo esa duda

Link to comment
  • 4 weeks later...

Complicado de entender tu post la verdad. Pero prueba esto:

function takeHealth( thePlayer, cmd )
	local x, y, z = getElementPosition( thePlayer )
	for i,players in ipairs(getElementsByType('player')) do
		local tx, ty, tz = getElementPosition( players )
		if getDistanceBetweenPoints3D( x, y, z, tx, ty, tz ) <= 50 then
			setElementHealth( players, getElementHealth( players ) - 80 )
		end
	end
end
addCommandHandler('take', takeHealth)

 

Edited by Rut
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...