Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local damageMoreOnEachThreshold = 5 -- meaning each time they hit that number add to the player damge the add more damge number
- local addMoreDamageOnEachThreshold = 4 -- each time they hit the damge more number add to the player that number
- local eachKillSpeedByThreshold = 3 -- meaning each time they kill that many people add to the player speed the number on add speed addSpeedMoreOnEachThreshold = 1.5 -- each time they hit the speed more number add to the player that number
- local kills = {}
- local labels = {}
- local playerDamage = {}
- local lb = UIService.createLeaderboard()
- local configuration = {
- OnlyPlayer = false
- }
- local function damageMoreOnEach(player)
- if kills[player] % damageMoreOnEachThreshold == 0 then
- playerDamage[player] = playerDamage[player] + addMoreDamageOnEachThreshold
- end
- end
- local function addMoreDamageOnEach(player)
- return addMoreDamageOnEachThreshold
- end
- local function addSpeedMoreOnEach(player)
- player:registerSpeedMultiplier("speed-boost", addSpeedMoreOnEachThreshold)
- end
- local function removeSpeedMoreOnEach(player)
- player:removeSpeedMultiplier("speed-boost")
- end
- local function createAndUpdateLabel(player)
- local playerEntity = player:getEntity()
- if playerEntity and playerEntity:isAlive() then
- kills[player] = 0
- playerDamage[player] = 0
- local killsLabel = UIService.createTextLabel("🔥 " .. kills[player], playerEntity:getPosition())
- killsLabel:setBackgroundColor(Color3.fromRGB(0, 0, 0))
- killsLabel:setBackgroundTransparency(0.1)
- killsLabel:setTextColor(Color3.fromRGB(255, 255, 255))
- killsLabel:setSize(UDim2.fromScale(10, 2))
- killsLabel:setFont(Font.Arcade)
- task.spawn(function()
- while playerEntity:isAlive() do
- wait(0.01)
- killsLabel:setPosition(playerEntity:getPosition() + Vector3.new(0, 5, 0))
- end
- killsLabel:destroy()
- end)
- labels[player] = killsLabel
- end
- end
- for _, player in pairs(PlayerService.getPlayers()) do
- if not player then continue end
- if kills[player] == nil then
- kills[player] = 0
- end
- lb:addKey(player, kills[player])
- lb:addScore(player, kills[player])
- createAndUpdateLabel(player)
- end
- Events.EntityDeath(function(event)
- local entity = event.entity
- local killer = event.killer
- if not killer then return end
- local player = killer:getPlayer()
- if not player then return end
- kills[player] = kills[player] + 1
- lb:setScore(player, kills[player])
- local currentLabel = labels[player]
- if currentLabel then
- currentLabel:setText("🔥 " .. kills[player])
- damageMoreOnEach(player)
- if kills[player] % eachKillSpeedByThreshold == 0 then
- addSpeedMoreOnEach(player)
- end
- end
- end)
- Events.EntityDamage(function(event)
- local player = event.entity:getPlayer()
- if player then
- event.damage = event.damage + addMoreDamageOnEach(player)
- end
- end)
- Events.EntitySpawn(function(event)
- local player = event.entity:getPlayer()
- if player then
- createAndUpdateLabel(player)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement