|
| 19 Nov 2013 09:42 AM |
local BadgeID = 135933219 --Badge ID Here
local HowMuch = 8
game.Players.PlayerAdded:connect(function(p)
repeat wait() until p:findFirstChild("leaderstats") ~= nil
p.leaderstats["KOs"].Changed:connect(function()
if p.leaderstats["KOs"].Value == HowMuch then game:GetService("BadgeService"):AwardBadge(p.userId, BadgeID) script.Sound:play() else return end
end)
end)
|
|
|
| Report Abuse |
|
|
|
| 19 Nov 2013 09:43 AM |
| Yea this is a small script. |
|
|
| Report Abuse |
|
|
|
| 19 Nov 2013 09:44 AM |
Do you know how and where to add a line where you make it that if you're in the team (in the game) "Pilgrims" you get the badge? (If you have 8KOs and IN that team). |
|
|
| Report Abuse |
|
|
| |
|
|
| 19 Nov 2013 09:55 AM |
| Can anyone help me with my question? |
|
|
| Report Abuse |
|
|
|
| 19 Nov 2013 10:05 AM |
if (p.TeamColor == game.Teams.Pilgrims.TeamColor) then -- Give them the badge end
Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson |
|
|
| Report Abuse |
|
|
|
| 19 Nov 2013 10:17 AM |
Thank you DaMrNelson.
And just to make sure, would it be like that (when adding that part):
local BadgeID = 135933219 --Badge ID Here
local HowMuch = 8
game.Players.PlayerAdded:connect(function(p)
repeat wait() until p:findFirstChild("leaderstats") ~= nil
p.leaderstats["KOs"].Changed:connect(function()
if p.leaderstats["KOs"].Value == HowMuch then if (p.TeamColor == game.Teams.Pilgrims.TeamColor) then game:GetService("BadgeService"):AwardBadge(p.userId, BadgeID) script.Sound:play() else return end
end end) end)
|
|
|
| Report Abuse |
|
|
|
| 19 Nov 2013 10:21 AM |
omg he is lrning :O I thought he would just ask you to fix his free model |
|
|
| Report Abuse |
|
|
|
| 19 Nov 2013 10:26 AM |
@Scriptual Haha oh well :3
@OP You don't need the "else return end" part. Simply leaving out the "else" part (but you still need that end) will work, and it takes less time to type.
Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson |
|
|
| Report Abuse |
|
|
|
| 19 Nov 2013 10:29 AM |
| Why does he still need the end? I only see 3 things that need a end |
|
|
| Report Abuse |
|
|
|
| 19 Nov 2013 10:32 AM |
Scriptural, I'm not a good scripter, but I'll be learning when I'll have free time. I'm a partner in 4Sci's project - Thanksgiving Game (Capture the Flags), and I was asked to handle the badge scripts.
I don't just give something and hope people will fix it.
I just expect for a small help from a good scripters. (XAXA and others are offline, so the only thing last is to ask in the forums). |
|
|
| Report Abuse |
|
|
|
| 19 Nov 2013 10:32 AM |
I was making sure that he understood that if he took out the "else return end" part, he'd need to add a new "end" to replace the "end" he took out... It probably would have just been simpler to say "you can just replace the 'else return' part" .-.
Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson |
|
|
| Report Abuse |
|
|
| |
|
|
| 19 Nov 2013 10:37 AM |
Sorry for bothering over and over.
But I made it like this:
--
local BadgeID = 135933219 local HowMuch = 8
game.Players.PlayerAdded:connect(function(p) p:WaitForDataReady() repeat wait() until p:findFirstChild("leaderstats") p.leaderstats:WaitForChild("KOs").Changed:connect(function(value) --it was 'KOs', right? if p.TeamColor == game.Teams.TeamNameHere.TeamColor then -- the line I changed if value == HowMuch then game:GetService("BadgeService"):AwardBadge(p.userId, BadgeID) script.Sound:play() end end end) end)
--
(Pretty same)
Is it okay? |
|
|
| Report Abuse |
|
|
|
| 19 Nov 2013 10:38 AM |
Ignore the comments "it was 'KOs', right?" or "the line I changed". Those are for me. |
|
|
| Report Abuse |
|
|
| |
|
|
| 19 Nov 2013 10:43 AM |
| It's not my game, I'm not BC (I can't sell badges), and the game owner is offline, I can't test it in no any way. Asking someone will just fail. |
|
|
| Report Abuse |
|
|
|
| 19 Nov 2013 10:45 AM |
From looking it over, it seems that that would work.
Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson |
|
|
| Report Abuse |
|
|
| |
|