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 » Scripters
Home Search
 

Re: Someone help me with a script

Previous Thread :: Next Thread 
SinisterDoggy is not online. SinisterDoggy
Joined: 18 Nov 2011
Total Posts: 4576
02 Feb 2015 02:58 PM
I want to award a badge for people who killed me in game, and I presume it's a script. Does anyone know the script?
Report Abuse
ChiefDelta is not online. ChiefDelta
Joined: 05 Nov 2010
Total Posts: 13071
02 Feb 2015 03:00 PM
You use BadgeService and AwardBadge, it takes player.userId & badgeId as arguments.
Report Abuse
SinisterDoggy is not online. SinisterDoggy
Joined: 18 Nov 2011
Total Posts: 4576
02 Feb 2015 03:03 PM
Do you have an actual script wit instructions?
Report Abuse
ChiefDelta is not online. ChiefDelta
Joined: 05 Nov 2010
Total Posts: 13071
02 Feb 2015 03:06 PM
local badgeService = game:GetService('BadgeService')
local BADGE_ID = 000

game.Players.PlayerAdded:connect(function(player)
badgeService:AwardBadge(player.userId, BADGE_ID)
end)
Report Abuse
SinisterDoggy is not online. SinisterDoggy
Joined: 18 Nov 2011
Total Posts: 4576
02 Feb 2015 03:26 PM
player.userId, BADGE_ID)
Would I erase userId and put my id
and erase BADGE_ID and put the badge id of the model?
Report Abuse
oscar9999991 is not online. oscar9999991
Joined: 15 Nov 2009
Total Posts: 11373
02 Feb 2015 03:27 PM
Duh
Report Abuse
SinisterDoggy is not online. SinisterDoggy
Joined: 18 Nov 2011
Total Posts: 4576
02 Feb 2015 03:32 PM
Didn't work
Report Abuse
SinisterDoggy is not online. SinisterDoggy
Joined: 18 Nov 2011
Total Posts: 4576
02 Feb 2015 03:33 PM
.
Report Abuse
SinisterDoggy is not online. SinisterDoggy
Joined: 18 Nov 2011
Total Posts: 4576
02 Feb 2015 03:33 PM
z
Report Abuse
SinisterDoggy is not online. SinisterDoggy
Joined: 18 Nov 2011
Total Posts: 4576
02 Feb 2015 03:35 PM
m
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
02 Feb 2015 03:35 PM
game.Players.PlayerAdded:connect(function(player)
if (player.userId == game.CreatorId) then
player.CharacterAdded:connect(function(character)
character.Humanoid.Died:wait()
if (character.Humanoid:FindFirstChild("creator") and character.Humanoid.creator.Value) then
game:GetService("BadgeService"):AwardBadge(character.Humanoid.creator.Value, badgeId)
end
end)
end
end)


--[[Replace badgeId with the badges item ID]]
Report Abuse
SinisterDoggy is not online. SinisterDoggy
Joined: 18 Nov 2011
Total Posts: 4576
02 Feb 2015 03:41 PM
And where would I put my player id?
Report Abuse
RobuxLife is not online. RobuxLife
Joined: 19 Sep 2012
Total Posts: 13336
02 Feb 2015 03:42 PM
*Facepalm*

You don't.
Report Abuse
Astrain1 is not online. Astrain1
Joined: 27 Mar 2013
Total Posts: 18697
02 Feb 2015 03:42 PM
"And where would I put my player id?"

His script'll cover that for you.


jeb get me the seperatrons | go get hit by a speeding commuter train
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
02 Feb 2015 03:43 PM
You don't need to put your id in it

if (player.userId == game.CreatorId) then



It automatically checks the game creators ID
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
02 Feb 2015 03:44 PM
You do need to replace this line though
game:GetService("BadgeService"):AwardBadge(character.Humanoid.creator.Value, badgeId)


with

game:GetService("BadgeService"):AwardBadge(character.Humanoid.creator.Value.userId, badgeId)



Because I forgot the .userId part
And of course still need to replace badgeId with the badges item ID
Report Abuse
SinisterDoggy is not online. SinisterDoggy
Joined: 18 Nov 2011
Total Posts: 4576
02 Feb 2015 03:46 PM
So i'll have
game.Players.PlayerAdded:connect(function(player)
if (player.userId == game.CreatorId) then
player.CharacterAdded:connect(function(character)
character.Humanoid.Died:wait()
if (character.Humanoid:FindFirstChild("creator") and character.Humanoid.creator.Value) then
game:GetService("BadgeService"):AwardBadge(character.Humanoid.creator.Value.userId, badgeId)
end
end)
end
end)


--[[Replace badgeId with the badges item ID]]


BUT with my badge id it'll be

game.Players.PlayerAdded:connect(function(player)
if (player.userId == game.CreatorId) then
player.CharacterAdded:connect(function(character)
character.Humanoid.Died:wait()
if (character.Humanoid:FindFirstChild("creator") and character.Humanoid.creator.Value) then
game:GetService("BadgeService"):AwardBadge(character.Humanoid.creator.Value.userId, 211399772)
end
end)
end
end)


--[[Replace badgeId with the badges item ID]]
Report Abuse
SinisterDoggy is not online. SinisterDoggy
Joined: 18 Nov 2011
Total Posts: 4576
02 Feb 2015 03:48 PM
.
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
02 Feb 2015 03:48 PM
Yep should work

You can remove this too
'--[[Replace badgeId with the badges item ID]]'

Its not gonna hurt anything its just a comment, leave it there if you want but you can take it off
Report Abuse
SinisterDoggy is not online. SinisterDoggy
Joined: 18 Nov 2011
Total Posts: 4576
02 Feb 2015 03:50 PM
It works
Thank you (:
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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