Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local speed = 30
- local attackDistance = 25
- local damageAmount = 17.5
- local customMaxHealth = 100
- local spawnWaitTime = 20
- local customHandItem = ItemType.SKY_SCYTHE
- local customKitType = KitType.FROSTY
- local damageMultiplier = 20
- local hitSound = SoundType.PENGUIN_ATTACK_3
- local spawnSound = SoundType.WIZARD_LIGHTNING_CAST
- Events.EntityDamage(function(event)
- event.knockback.horizontal = 0
- event.knockback.vertical = 0
- local kit = event.entity
- local kitHealth = kit:getHealth()
- local halfHealth = customMaxHealth / 2
- if kitHealth == halfHealth then
- event.damage = event.damage * damageMultiplier
- end
- SoundService.playSound(hitSound, kit:getPosition())
- end)
- while true do
- local pos = BlockService.getAboveRandomBlock({"wool_white"}) -- Updated block type
- if not pos then
- error("No wool_white block found!") -- Updated error message
- end
- pos = Vector3.new(pos.X, pos.Y + 10, pos.Z)
- SoundService.playSound(spawnSound, pos)
- local kit = EntityService.spawnKitEntity(customKitType, pos)
- kit:setMaxHealth(customMaxHealth)
- kit:setHandItem(customHandItem)
- kit:setSpeed(speed)
- task.spawn(function()
- while true do
- local players = PlayerService.getPlayers()
- if #players > 0 then
- local randomPlayer = players[math.random(#players)]
- if randomPlayer then
- local playerPos = randomPlayer:getEntity():getPosition()
- kit:setPosition(playerPos)
- kit:moveTo(playerPos)
- local kitPos = kit:getPosition()
- local distance = (playerPos - kitPos).Magnitude
- if distance <= attackDistance then
- CombatService.damage(randomPlayer:getEntity(), damageAmount, {
- horizontal = 0,
- vertical = 0,
- fromPosition = playerPos
- })
- task.wait(0.0000001)
- end
- end
- end
- task.wait(1)
- end
- end)
- task.wait(spawnWaitTime)
- end
- print("Script has worked! Made by Cat in the Hat!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement