ShoeBox4
|
  |
| Joined: 06 Apr 2011 |
| Total Posts: 890 |
|
|
| 28 Aug 2011 02:04 PM |
Ok, I have this script that ElectricBlaze half way fixed :P It's supposed to Put a checkmark next to the picture if the player has the badge, if not, it has a red x. Here's the script. Oh, and it doesn't have any output.
local b = game:GetService("BadgeService")
ImageId = {"87358052", "87359198", "87358683", "87359204", "87359207", "87359210", "87359260", "87359341", "87359249"}
game.Players.ChildAdded:connect(function(player) player.CharacterAdded:wait() local check = player.PlayerGui.ScreenGui.Checkmark if b:UserHasBadge(player.userId, ImageId[_G.i] or "") then check.Image = "http://gametest.roblox.com/asset/?id=87364118" -- Checkmark image else check.Image = "http://gametest.roblox.com/asset/?id=87364114" -- X image end end)
|
|
|
| Report Abuse |
|
|
BCGames
|
  |
| Joined: 30 Dec 2010 |
| Total Posts: 8182 |
|
|
| 28 Aug 2011 02:09 PM |
LocalScript? Also, how could this ever work in test mode? |
|
|
| Report Abuse |
|
|
ShoeBox4
|
  |
| Joined: 06 Apr 2011 |
| Total Posts: 890 |
|
|
| 28 Aug 2011 02:12 PM |
| I don't know it just does. |
|
|
| Report Abuse |
|
|
BCGames
|
  |
| Joined: 30 Dec 2010 |
| Total Posts: 8182 |
|
|
| 28 Aug 2011 02:13 PM |
| That's impossible. It uses badge service. |
|
|
| Report Abuse |
|
|
ShoeBox4
|
  |
| Joined: 06 Apr 2011 |
| Total Posts: 890 |
|
|
| 28 Aug 2011 02:15 PM |
| It shows a red x. Because Player doesn't have any badges. |
|
|
| Report Abuse |
|
|
|
| 28 Aug 2011 02:15 PM |
| PlayerId in test mode is always 0, so it shouldn't work |
|
|
| Report Abuse |
|
|
BCGames
|
  |
| Joined: 30 Dec 2010 |
| Total Posts: 8182 |
|
|
| 28 Aug 2011 02:16 PM |
That doesn't mean it works. That means it didn't run the check at all. Again, is this a LocalScript? |
|
|
| Report Abuse |
|
|
ShoeBox4
|
  |
| Joined: 06 Apr 2011 |
| Total Posts: 890 |
|
| |
|
BCGames
|
  |
| Joined: 30 Dec 2010 |
| Total Posts: 8182 |
|
|
| 28 Aug 2011 02:20 PM |
| BTW, I said this yesterday. You are giving BadgeService a string and not an int. Your table is full of STRINGS. It should be full of INTS. |
|
|
| Report Abuse |
|
|
ShoeBox4
|
  |
| Joined: 06 Apr 2011 |
| Total Posts: 890 |
|
| |
|
ShoeBox4
|
  |
| Joined: 06 Apr 2011 |
| Total Posts: 890 |
|
|
| 28 Aug 2011 02:22 PM |
| But it still doesn't work when I press Play. |
|
|
| Report Abuse |
|
|
BCGames
|
  |
| Joined: 30 Dec 2010 |
| Total Posts: 8182 |
|
|
| 28 Aug 2011 02:23 PM |
| Wtf? Play? How are you testing this? The only way to test this is to save it to a place and test. |
|
|
| Report Abuse |
|
|
ShoeBox4
|
  |
| Joined: 06 Apr 2011 |
| Total Posts: 890 |
|
|
| 28 Aug 2011 02:24 PM |
| Uhmmmm... Well, I press save. I quit Studio. I go to my places. Then click the green "Play" button... |
|
|
| Report Abuse |
|
|
BCGames
|
  |
| Joined: 30 Dec 2010 |
| Total Posts: 8182 |
|
|
| 28 Aug 2011 02:25 PM |
| Ok. Did you remove the "s in the table? |
|
|
| Report Abuse |
|
|
ShoeBox4
|
  |
| Joined: 06 Apr 2011 |
| Total Posts: 890 |
|
| |
|
BCGames
|
  |
| Joined: 30 Dec 2010 |
| Total Posts: 8182 |
|
|
| 28 Aug 2011 02:27 PM |
local b = game:GetService("BadgeService")
ImageId = { 87358052, 87359198, 87358683, 87359204, 87359207, 87359210, 87359260, 87359341, 87359249 }
game.Players.ChildAdded:connect(function(player) player.CharacterAdded:wait() local check = player.PlayerGui.ScreenGui.Checkmark if b:UserHasBadge(player.userId, ImageId[_G.i] or 0) then check.Image = "http://gametest.roblox.com/asset/?id=87364118" -- Checkmark image else check.Image = "http://gametest.roblox.com/asset/?id=87364114" -- X image end end) |
|
|
| Report Abuse |
|
|
ShoeBox4
|
  |
| Joined: 06 Apr 2011 |
| Total Posts: 890 |
|
|
| 28 Aug 2011 02:31 PM |
| Ok, now it shows the red X. But since I'm the owner, they should all be checkmarks. |
|
|
| Report Abuse |
|
|
|
| 28 Aug 2011 02:40 PM |
| Test it on the real online server. |
|
|
| Report Abuse |
|
|
| |
|
ShoeBox4
|
  |
| Joined: 06 Apr 2011 |
| Total Posts: 890 |
|
|
| 28 Aug 2011 02:47 PM |
@Galaxy
I am testing it that way.
@rangersmash
I'm making my game on gametest. |
|
|
| Report Abuse |
|
|
|
| 28 Aug 2011 02:49 PM |
| Why are you making it on gametest? You could lose the whole game |
|
|
| Report Abuse |
|
|
ShoeBox4
|
  |
| Joined: 06 Apr 2011 |
| Total Posts: 890 |
|
|
| 28 Aug 2011 02:51 PM |
| Because somebody put OBC on my account :3 |
|
|
| Report Abuse |
|
|
ShoeBox4
|
  |
| Joined: 06 Apr 2011 |
| Total Posts: 890 |
|
|
| 28 Aug 2011 02:56 PM |
| You know what I just realized? I put the ImageIds for the bunny IMAGES instead of the BadgeIds.... Fail... |
|
|
| Report Abuse |
|
|
ShoeBox4
|
  |
| Joined: 06 Apr 2011 |
| Total Posts: 890 |
|
|
| 28 Aug 2011 03:48 PM |
Ok, I added a 'while true do' and I got some wierd output... Here's the output.
Sun Aug 28 13:46:35 2011 - PlayerGui is not a valid member of Player Sun Aug 28 13:46:35 2011 - Script "Workspace.Script", Line 13
And here's the script.
BunnyId = {87358053, -- Classic 87359202, -- Grass 87358684, -- Black 87359205, -- Lava 87359208, -- Ninja 87359212, -- Snow 87359264, -- Stone 87359342, -- Question 87359250} -- Cloud
game.Players.ChildAdded:connect(function(player) while true do local check = player.PlayerGui.ScreenGui.Checkmark -- This would be line 13 local b = game:GetService("BadgeService") if b:UserHasBadge(player.userId, BunnyId[_G.i]) then check.Image = "http://gametest.roblox.com/asset/?id=87364118" -- Checkmark image else check.Image = "http://gametest.roblox.com/asset/?id=87364114" -- X image end end end)
|
|
|
| Report Abuse |
|
|
| |
|