skill24
|
  |
| Joined: 14 Jun 2009 |
| Total Posts: 13608 |
|
|
| 06 Jul 2013 11:17 AM |
k so i made a badge for my tycoon now how do i make it so you are awarded it when you buy a certain item at the tycoon? Anyone? Please reply |
|
|
| Report Abuse |
|
|
|
| 06 Jul 2013 11:18 AM |
| Game:GetService("BadgeService"):AwardBadge(PLAYER.UserId, BADGEID) |
|
|
| Report Abuse |
|
|
|
| 06 Jul 2013 11:19 AM |
| Inside of the script that lets you purchase the item just use BadgeService to award the players user id with the badges id. |
|
|
| Report Abuse |
|
|
|
| 06 Jul 2013 11:19 AM |
| Find button where you buy item, it probably has a script with a function called something like ontouched. Somewhere in that script probably after an if statement that says if plyr has enough money or something like that, put the give badge script |
|
|
| Report Abuse |
|
|
|
| 06 Jul 2013 11:20 AM |
| Does UserId work? I've always used userId, but I'd prefer UserId |
|
|
| Report Abuse |
|
|
|
| 06 Jul 2013 11:22 AM |
Ah, no you're right. Habit to capitalize.
Game:GetService("BadgeService"):AwardBadge(PLAYER.userId, BADGEID)
|
|
|
| Report Abuse |
|
|
skill24
|
  |
| Joined: 14 Jun 2009 |
| Total Posts: 13608 |
|
| |
|
|
| 06 Jul 2013 11:25 AM |
| That is the method to award a badge. I have no idea how your shop works, so I don't know what else to include. |
|
|
| Report Abuse |
|
|
skill24
|
  |
| Joined: 14 Jun 2009 |
| Total Posts: 13608 |
|
|
| 06 Jul 2013 11:50 AM |
Do you cpy and paste this into the brick you touch to buy the item? Game:GetService("BadgeService"):AwardBadge(PLAYER.userId, BADGEID)
|
|
|
| Report Abuse |
|
|
woot3
|
  |
| Joined: 10 Nov 2008 |
| Total Posts: 3599 |
|
|
| 06 Jul 2013 11:56 AM |
local badgeId = ID OF BADGE
script.Parent.Touched:connect(function (hit) if hit.Parent and game.Players:FindFirstChild(hit.Parent.Name) then game:GetService("BadgeService"):AwardBadge(game.Players[hit.Parent.Name.userId], badgeId) end end) |
|
|
| Report Abuse |
|
|