generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Award badge on number of bloxxes?

Previous Thread :: Next Thread 
georgeba is not online. 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
Cr4shImp4ct is not online. Cr4shImp4ct
Joined: 23 Nov 2013
Total Posts: 107
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image