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
 

How do I change the script inside a badge giver?

Previous Thread :: Next Thread 
The1FaZeTemperr is not online. The1FaZeTemperr
Joined: 04 Sep 2013
Total Posts: 1156
19 Jan 2014 07:57 PM
Hey forumers!

Okay, so I am currently making badges for my new game and I have absolutely no clue how to make the badges work in different ways. I have one badge which is just a block that gives you the badge, but what about a badge for "Met the Creator" or for "Getting 500 kills" or even for "Owning 4 other badges". Could you please tell me what the scripts are or where I could find them? Also, in the badge giver do I just delete the entire script inside of the BadgeAwarderScript, or do I have to delete certain areas and not others?
Please reply with all help or support in the comments and thank you very much for the help!

~The1FaZeTemperr
Avid Forumer
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
19 Jan 2014 08:00 PM
Specify some conditions and add an if statement saying the if the conditions are true, the badge will be awarded.
Report Abuse
ElectricAxel is not online. ElectricAxel
Joined: 15 May 2009
Total Posts: 16239
19 Jan 2014 08:08 PM
I think you need more Scripting knowledge for those, you MIGHT be able to find working versions in Free models. Best of luck. :B
Report Abuse
The1FaZeTemperr is not online. The1FaZeTemperr
Joined: 04 Sep 2013
Total Posts: 1156
19 Jan 2014 08:08 PM
Okay, could someone give me an example of a badge that would be given for having 4 other badges? I am honestly NOT a scripter at all but I am learning and understand the language of Lua but have not yet learned to write it well.
Thanks!

~FaZe
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
19 Jan 2014 08:19 PM
Something like this;

local Id1 = BadgeID1Here
local Id2 = BadgeID2Here
local Id3 = BadgeID3Here
local Id4 = BadgeID4Here
local Id5 = AwardingBadgeIDHere

function isAuthenticated(player)
if game:GetService("BadgeService"):PlayerHasBadge(player, Id1,Id2,Id3,Id4) then
game:GetService('BadgeService'):AwardBadge(game.Players.Player.userId, Id5)

game.Players.PlayerAdded:connect(function(plr)
if isAuthenticated(plr) then
print(plr.Name .. " has bought the game pass with id " .. passId)
end end) end end
Report Abuse
ElectricAxel is not online. ElectricAxel
Joined: 15 May 2009
Total Posts: 16239
19 Jan 2014 08:30 PM
Its UserHasBadge, and it only takes 1 Id at a time:

http://wiki.roblox.com/index.php/UserHasBadge_(Method)
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
19 Jan 2014 08:35 PM
Oops sorry for misinforming you.
Report Abuse
The1FaZeTemperr is not online. The1FaZeTemperr
Joined: 04 Sep 2013
Total Posts: 1156
19 Jan 2014 09:14 PM
No problem! Does anyone know how to do it correctly? Thanks ahead of time!
Report Abuse
ElectricAxel is not online. ElectricAxel
Joined: 15 May 2009
Total Posts: 16239
19 Jan 2014 09:18 PM
So ... 500 kills, is that KO, KOs or Kills in your leaderboard? Do you only have 5 badges or do you have more? I suppose the creator is you... I'll give it a shot once you answer.
Report Abuse
The1FaZeTemperr is not online. The1FaZeTemperr
Joined: 04 Sep 2013
Total Posts: 1156
19 Jan 2014 09:26 PM
It will be marked as kills. The badges will be 4. Thanks!

~FaZe
Report Abuse
ElectricAxel is not online. ElectricAxel
Joined: 15 May 2009
Total Posts: 16239
19 Jan 2014 09:43 PM
--untested--

killBadgeID = 1234567 --this is the id of the badge for kills
meetBadgeID = 2345678 --this is for meeting you
huntBadgeID = 3456789 --this is for when you have the other badges
otherIDs = {} --these are any badges I did not include above

numToAward = 3 --if you have 3 other badges, it will give you huntBadge

killCount = 500 --amount to get killBadge
killName = "Kills" --name in leaderstats

creator = ("the1fazetemperr"):lower() --your name in lower case

--This below is to be ignored. :B--

local bs = game:GetService("BadgeService")

game.Players.PlayerAdded:connect(function(p)
local pID = p.UserId
repeat wait() until p:findFirstChild("leaderstats")
p.leaderstats[killName].Changed:connect(function(w)
if w == "Value" and p.leaderstats[killName].Value >= killCount and (not bs:UserHasBadge(pID, killBadgeID)) then
bs:AwardBadge(pID, killBadgeID);
end
end)
for i, v in pairs(game.Players:GetPlayers()) do
if v.Name:lower() == creator then
if (not bs:UserHasBadge(pID, meetBadgeID)) then
bs:AwardBadge(pID, meetBadgeID);
end
end
end
--this one is only granted once they come in game, sadly
local c = 0;
if bs:UserHasBadge(pID, killBadgeID) then
c = c + 1;
end
if bs:UserHasBadge(pID, meetBadgeID) then
c = c + 1;
end
for i, v in pairs(otherIDs) do
if bs:UserHasBadge(pID, v) then
c = c + 1;
end
end
if c >= numToAward then
if (not bs:UserHasBadge(pID, huntBadgeID)) then
bs:AwardBadge(pID, huntBadgeID);
end
end
end)
Report Abuse
The1FaZeTemperr is not online. The1FaZeTemperr
Joined: 04 Sep 2013
Total Posts: 1156
19 Jan 2014 09:51 PM
Thank you very much! I will try this out to see if it works, I will fill in the needed areas of course. Thanks again! If I have any questions I will PM you. Thanks!!

~FaZe
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