georgeba
|
  |
| Joined: 29 Oct 2011 |
| Total Posts: 1092 |
|
|
| 27 Nov 2013 12:50 AM |
| How would I make a script that awards a badge if the player gets 1 kill? |
|
|
| Report Abuse |
|
|
| 27 Nov 2013 01:17 AM |
game.Players.PlayerAdded:connect(function(player) local model = Instance.new('Model', player) local kills = Instance.new('IntValue', model) local deaths = Instance.new('IntValue', model)
model.Name = 'leaderstats' kills.Name = 'Kills' deaths.Name = 'Deaths'
for _, v in pairs(model:GetChildren()) do v.Changed:connect(function() if (v.Name == 'Kills') then if (v.Value == 1) then game:GetService('BadgeService'):AwardBadge(player.userId, 000000) end end end) end
player.Characteradded:connect(function(character) local humanoid = character.Humanoid
character.Humanoid.Died:connect(function() player.leaderstats.Deaths = player.leaderstats.Deaths + 1
if (humanoid:FindFirstChild('creator')) and (game:GetService('Players'):FindFirstChild(humanoid.creator.Value) then game:GetService('Players')[humanoid.creator.Value].leaderstats.Kills = game:GetService('Players')[humanoid.creator.Value].leaderstats.Kills + 1 end end) end) end) |
|
|
| Report Abuse |
|