Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local BLOCK_STOMP_ABILITY = "BLOCK_STOMP"
- AbilityService.createAbility(BLOCK_STOMP_ABILITY, KeyCode.X, {
- maxProgress = 60,
- progressPerUse = 60,
- })
- -- Enable BLOCK_STOMP ability for all players
- for _, player in pairs(PlayerService.getPlayers()) do
- AbilityService.enableAbility(player, BLOCK_STOMP_ABILITY)
- end
- local storedPosition
- Events.UseAbility(function(event)
- if event.abilityName == BLOCK_STOMP_ABILITY then
- local player = event.entity
- StatusEffectService.giveEffect(player, StatusEffectType.SPEED_PIE, 1002)
- local function placeIceBlock(position)
- BlockService.placeBlock(ItemType.ICE, position)
- end
- local function createIceCircle(centerPosition, radius, height)
- local steps = 360
- for angle = 0, 2 * math.pi, 2 * math.pi / steps do
- local dx = radius * math.cos(angle)
- local dz = radius * math.sin(angle)
- local positionToPlace = centerPosition + Vector3.new(dx, -height, dz)
- placeIceBlock(positionToPlace)
- end
- end
- local function spawnIceCircles(playerPosition)
- local maxRadius = 60
- local heightOffset = 5
- while maxRadius > 0 do
- local elevatedPosition = playerPosition + Vector3.new(0, heightOffset + 114, 0)
- createIceCircle(elevatedPosition, maxRadius, maxRadius * 2)
- heightOffset = heightOffset + 0.5
- maxRadius = maxRadius - 0.5
- task.wait(0.1)
- end
- end
- storedPosition = player:getPosition()
- spawnIceCircles(storedPosition)
- end
- end)
- task.wait(3)
- local function destroyBlocksInCircle(centerPosition, radius, height)
- local steps = 360
- for angle = 0, 2 * math.pi, 2 * math.pi / steps do
- local dx = radius * math.cos(angle)
- local dz = radius * math.sin(angle)
- local positionToDestroy = storedPosition + Vector3.new(dx, -height, dz)
- BlockService.destroyBlock(positionToDestroy)
- end
- end
- local function spawnBlockCircles(storedPosition)
- local maxRadius = 60
- local heightOffset = 5
- while maxRadius > 0 do
- local elevatedPosition = storedPosition + Vector3.new(0, heightOffset + 114, 0)
- destroyBlocksInCircle(elevatedPosition, maxRadius, maxRadius * 2)
- heightOffset = heightOffset + 0.5
- maxRadius = maxRadius - 0.5
- task.wait(0.1)
- end
- end
- spawnBlockCircles(storedPosition)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement