Lalalu Posted September 22, 2019 Share Posted September 22, 2019 Hola, quisiera saber como puedo crear un circulo de explosiones en una posición delante de mi específicamente, me refiero a varias explosiones que formen una especie de circulo en 360 grados Link to comment
#Dv^ Posted September 22, 2019 Share Posted September 22, 2019 (edited) 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 September 22, 2019 by #Dv^ 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