Advertisement
Cat_in_the_hat

Ice queen ice wall ability 1/?

Dec 16th, 2023
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 KB | Gaming | 0 0
  1.  
  2. local BLOCK_STOMP_ABILITY = "BLOCK_STOMP"
  3.  
  4. AbilityService.createAbility(BLOCK_STOMP_ABILITY, KeyCode.X, {
  5. maxProgress = 60,
  6. progressPerUse = 60,
  7. })
  8.  
  9. -- Enable BLOCK_STOMP ability for all players
  10. for _, player in pairs(PlayerService.getPlayers()) do
  11. AbilityService.enableAbility(player, BLOCK_STOMP_ABILITY)
  12. end
  13.  
  14. local storedPosition
  15.  
  16. Events.UseAbility(function(event)
  17. if event.abilityName == BLOCK_STOMP_ABILITY then
  18. local player = event.entity
  19. StatusEffectService.giveEffect(player, StatusEffectType.SPEED_PIE, 1002)
  20.  
  21. local function placeIceBlock(position)
  22. BlockService.placeBlock(ItemType.ICE, position)
  23. end
  24.  
  25. local function createIceCircle(centerPosition, radius, height)
  26. local steps = 360
  27.  
  28. for angle = 0, 2 * math.pi, 2 * math.pi / steps do
  29. local dx = radius * math.cos(angle)
  30. local dz = radius * math.sin(angle)
  31. local positionToPlace = centerPosition + Vector3.new(dx, -height, dz)
  32. placeIceBlock(positionToPlace)
  33. end
  34. end
  35.  
  36. local function spawnIceCircles(playerPosition)
  37. local maxRadius = 60
  38. local heightOffset = 5
  39.  
  40. while maxRadius > 0 do
  41. local elevatedPosition = playerPosition + Vector3.new(0, heightOffset + 114, 0)
  42. createIceCircle(elevatedPosition, maxRadius, maxRadius * 2)
  43.  
  44. heightOffset = heightOffset + 0.5
  45. maxRadius = maxRadius - 0.5
  46. task.wait(0.1)
  47. end
  48. end
  49.  
  50. storedPosition = player:getPosition()
  51. spawnIceCircles(storedPosition)
  52. end
  53. end)
  54.  
  55. task.wait(3)
  56.  
  57. local function destroyBlocksInCircle(centerPosition, radius, height)
  58. local steps = 360
  59.  
  60. for angle = 0, 2 * math.pi, 2 * math.pi / steps do
  61. local dx = radius * math.cos(angle)
  62. local dz = radius * math.sin(angle)
  63. local positionToDestroy = storedPosition + Vector3.new(dx, -height, dz)
  64. BlockService.destroyBlock(positionToDestroy)
  65. end
  66. end
  67.  
  68. local function spawnBlockCircles(storedPosition)
  69. local maxRadius = 60
  70. local heightOffset = 5
  71.  
  72. while maxRadius > 0 do
  73. local elevatedPosition = storedPosition + Vector3.new(0, heightOffset + 114, 0)
  74. destroyBlocksInCircle(elevatedPosition, maxRadius, maxRadius * 2)
  75.  
  76. heightOffset = heightOffset + 0.5
  77. maxRadius = maxRadius - 0.5
  78. task.wait(0.1)
  79. end
  80. end
  81.  
  82. spawnBlockCircles(storedPosition)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement