Jump to content

Circle Explosions


Lalalu

Recommended Posts

La useful getPointFromDistanceRotation te puede ayudar a este problema, mira su ejemplo.
 

-- Uselful
function getPointFromDistanceRotation(x, y, dist, angle)
    local a = math.rad(90 - angle);
    local dx = math.cos(a) * dist;
    local dy = math.sin(a) * dist;
    return x+dx, y+dy;
end

-- Server-side
addCommandHandler("explosion",
function (player)
  local x,y,z = getElementPosition(player);
  for i=1, 8 do
    local newX, newY = getPointFromDistanceRotation(x, y, 2, 360 * (i/8));
    createExplosion(newX, newY, z, 0, player)
  end
end
);

 

Edited by #Dv^
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...