Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local skulls = {}
- local function getRandomSpeed()
- return math.random() * 0.2 + 0.4
- end
- local function getRandomRadius()
- return math.random(7, 12)
- end
- local function getRandomAxis()
- local axes = {
- Vector3.new(1, 0, 0),
- Vector3.new(0, 1, 0),
- Vector3.new(0, 0, 1)
- }
- return axes[math.random(1, #axes)]
- end
- local function getRandomScale()
- return math.random(3.2, 5)
- end
- local shotSoundList = {
- "CHRISTMAS_ELDERTREE_PICKUP",
- "CHRISTMAS_ELDERTREE_PICKUP_2",
- "CHRISTMAS_ELDERTREE_PICKUP_3"
- }
- local currentShotSoundIndex = 1
- local function spawnOrbitingSkull(player)
- local playerEntity = player:getEntity()
- local model = ModelService.createModel("eldertree_orb", playerEntity:getPosition() + Vector3.new(0, 3.2, 0))
- model:setScale(getRandomScale())
- model:setAnchored(true)
- model:setCollidable(false)
- SoundService.playSound(SoundType.WARLOCK_SIPHON_START, model:getPosition())
- local radius = getRandomRadius()
- local angle = 0
- local angleIncrement = getRandomSpeed()
- local spinAxis = getRandomAxis()
- local spinSpeed = getRandomSpeed()
- local function orbit()
- while playerEntity:isAlive() do
- wait(0.01)
- local playerPosition = playerEntity:getPosition()
- local newX = playerPosition.x + radius * math.cos(angle)
- local newZ = playerPosition.z + radius * math.sin(angle)
- model:setPosition(Vector3.new(newX, playerPosition.y + 2, newZ))
- angle = angle + angleIncrement
- if angle > 2 * math.pi then
- angle = angle - 2 * math.pi
- end
- model:setRotation(model:getRotation() + spinAxis * spinSpeed)
- end
- model:destroy()
- end
- task.spawn(orbit)
- task.spawn(function()
- while playerEntity:isAlive() do
- wait(3)
- radius = getRandomRadius()
- angleIncrement = getRandomSpeed()
- end
- end)
- task.spawn(function()
- while playerEntity:isAlive() do
- wait(1.5)
- spinAxis = getRandomAxis()
- spinSpeed = getRandomSpeed()
- end
- end)
- task.spawn(function()
- while playerEntity:isAlive() do
- wait(math.random(1, 4))
- SoundService.playSound(SoundType.BLOOD_HARVEST_GRIM_REAPER_CHANNEL, model:getPosition())
- end
- end)
- task.spawn(function()
- while playerEntity:isAlive() do
- wait(1)
- model:setScale(getRandomScale())
- end
- end)
- if not skulls[player] then
- skulls[player] = {}
- end
- table.insert(skulls[player], {model = model, orbitTask = orbit})
- end
- Events.EntityDeath(function(event)
- local killer = event.killer
- if killer then
- local player = killer:getPlayer()
- if player then
- spawnOrbitingSkull(player)
- end
- end
- end)
- local soulSeekerAbilityName = "soul seeker"
- AbilityService.createAbility(soulSeekerAbilityName, KeyCode.Z, {
- maxProgress = 30,
- progressPerUse = 10,
- iconImage = "rbxassetid://10653373712"
- })
- local function enableSoulSeekerForPlayer(player)
- AbilityService.enableAbility(player, soulSeekerAbilityName)
- end
- local function enableSoulSeekerForAllPlayers()
- for _, player in pairs(PlayerService.getPlayers()) do
- enableSoulSeekerForPlayer(player)
- end
- end
- enableSoulSeekerForAllPlayers()
- Events.PlayerAdded(function(event)
- local player = event.player
- task.spawn(function()
- wait(5)
- enableSoulSeekerForPlayer(player)
- end)
- end)
- Events.UseAbility(function(event)
- if event.abilityName == soulSeekerAbilityName then
- local player = event.entity:getPlayer()
- local function useSoulSeeker(player)
- local playerSkulls = skulls[player]
- if not playerSkulls or #playerSkulls == 0 then
- MessageService.sendError(player, "You need to kill someone first to use the ability.")
- return false
- end
- local skullData = table.remove(playerSkulls, math.random(1, #playerSkulls))
- skullData.model:destroy()
- return true
- end
- if not useSoulSeeker(player) then
- return
- end
- local function createNewSkull()
- local offset = Vector3.new(0, -1, -2.5)
- local position = (event.entity:getCFrame() * CFrame.new(offset))
- local newSkullModel = ModelService.createItemModel("headhunt_skull", Vector3.new(0, 0, 0))
- newSkullModel:setAnchored(true)
- newSkullModel:setCollidable(false)
- newSkullModel:setScale(3.7)
- newSkullModel:setCFrame(position)
- local stepSize = Vector3.new(0, 0, -2)
- local moveInterval = 0.003
- SoundService.playSound(SoundType.FIRE_SHEEP_BREAK, newSkullModel:getPosition())
- task.spawn(function()
- repeat
- local newPosition = newSkullModel:getCFrame() * CFrame.new(stepSize)
- newSkullModel:setCFrame(newPosition)
- task.wait(moveInterval)
- until not newSkullModel
- end)
- task.spawn(function()
- while newSkullModel do
- SoundService.playSound(SoundType[shotSoundList[currentShotSoundIndex]], newSkullModel:getPosition())
- currentShotSoundIndex = (currentShotSoundIndex % #shotSoundList) + 1
- task.wait(0.3)
- end
- end)
- task.spawn(function()
- while newSkullModel do
- local nearbyEntities = EntityService.getNearbyEntities(newSkullModel:getPosition(), 8)
- if nearbyEntities then
- for _, entity in pairs(nearbyEntities) do
- local entityPlayer = entity:getPlayer()
- local entityTeam = TeamService.getTeam(entityPlayer)
- local eventTeam = TeamService.getTeam(event.entity:getPlayer())
- if entityPlayer and entityTeam and eventTeam and entityTeam == eventTeam then
- print("can't damge player teammates")
- else
- CombatService.damage(entity, 50)
- local reaperLightPosition = entity:getPosition() + Vector3.new(0, 6, 0)
- local reaperLightModel = ModelService.createItemModel("cluster_bomb", reaperLightPosition)
- reaperLightModel:setAnchored(true)
- reaperLightModel:setCollidable(false)
- reaperLightModel:setScale(5)
- StatusEffectService.giveEffect(entity, "werewolf_fear", 1)
- StatusEffectService.giveEffect(entity, "greased", 2)
- StatusEffectService.giveEffect(entity, "poison", 6)
- StatusEffectService.giveEffect(entity, "grounded", 1)
- StatusEffectService.giveEffect(entity, "bleed", 4)
- StatusEffectService.giveEffect(entity, "forest_4", 5)
- StatusEffectService.giveEffect(entity, "dizzy", 3)
- SoundService.playSound(SoundType.GRIMOIRE_CAST_COMPLETE, entity:getPosition() + Vector3.new(0, 2, 0))
- task.spawn(function()
- local timer = 5
- while timer > 0 do
- task.wait(1)
- timer = timer - 1
- end
- reaperLightModel:destroy()
- end)
- task.spawn(function()
- while reaperLightModel do
- local newPosition = entity:getPosition() + Vector3.new(0, 7, 0)
- reaperLightModel:setPosition(newPosition)
- task.wait(0)
- end
- end)
- end
- end
- end
- task.wait(0.15)
- end
- end)
- task.spawn(function()
- task.wait(10)
- newSkullModel:destroy()
- end)
- end
- createNewSkull()
- task.wait(0.5)
- end
- end)
Advertisement
Advertisement