IronNoob

Please login or register.

Login with username, password and session length
Advanced search  

News:

Migrated to dedicated hosting. Post any weirdness you observe in the Lounge.

Author Topic: K-K-K-Killing Streak  (Read 84 times)

0 Members and 1 Guest are viewing this topic.

Solotaire

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 529
    • View Profile
K-K-K-Killing Streak
« on: April 07, 2013, 12:25:51 pm »

This is compressed from a larger script I made a while ago, but I think it works.

Code: [Select]
game.Players.ChildAdded:connect(function(player)
local streak = Instance.new("IntValue", player)
streak.Name = "streak"
streak.Value = 0

local deathStreak = Instance.new("IntValue", player)
deathStreak.Name = "DeathStreak"
deathStreak.Value = 0

kills.Changed:connect(function()
player.streak.Value = player.streak.Value + 1
player.DeathStreak.Value = 0
killDeathStreak(player, streak.Value)
end)

while true do
if player.Character ~= nil then break end
wait(1)
end

player.Character.Humanoid.Died:connect(function()
player.DeathStreak.Value = player.DeathStreak.Value + 1
player.streak.Value = 0
end)

player.CharacterAdded:connect(function(character)
-- need to wait for character so that the bonus actually does something
killDeathStreak(player, player.DeathStreak.Value)
end)

end)

function killDeathStreak(player, streak)
-- put in whatever you want as the bonus
if streak == 3 then

elseif streak == 5 then

elseif streak == 7 then

elseif streak == 10 then

streak = 0
end
end
Logged
That information is above your security clearance, citizen.
 

Page created in 0.055 seconds with 22 queries.