Zeldaboy111

Circle Functie ]|[ Skript #401

Mar 25th, 2021
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. # Use armor stands to create skills (i.e. comet)
  2. # Zombie boss: hordes of zombies, etc
  3. # Skeleton boss: archer, summon skeletons, shoot arrow with high damage
  4. # Blaze boss: comet/fireball, summon blazes,
  5. # Stray (shaman): holds stick, summon angry wolves,
  6.  
  7. function getNewLocation(location: Location, offset: Integer, direction: Integer) :: Location:
  8. if {_direction} is 0:
  9. set {_location} to location {_offset} meters north of {_location}
  10. else if {_direction} is 1:
  11. set {_location} to location {_offset} meters east of {_location}
  12. else if {_direction} is 2:
  13. set {_location} to location {_offset} meters south of {_location}
  14. else if {_direction} is 3:
  15. set {_location} to location {_offset} meters west of {_location}
  16. return {_location}
  17.  
  18. function circle(loc: location, radius: Integer, amount: Integer, entity: EntityType):
  19. set {_startLocation} to location {_radius}+1 meters north of {_loc}
  20. set {_distance} to {_radius} / {_amount} * 2 +1
  21.  
  22.  
  23. loop {_amount} times:
  24. # Fix that the location is being rotated by getting the direction (loop-index%4)
  25. set {_startLocation} to getNewLocation({_startLocation}, {_distance}, 0)
  26. summon {_entity} at {_startLocation}
  27.  
  28. # Test commands
  29. command /circle <Integer> <Integer>:
  30. trigger:
  31. circle(location of player, argument 1, argument 2, armor stand)
  32.  
Advertisement
Add Comment
Please, Sign In to add comment