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
 

Re: Why does this work in test mode but not a regular server?

Previous Thread :: Next Thread 
ShoeBox4 is not online. 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 is not online. 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 is not online. ShoeBox4
Joined: 06 Apr 2011
Total Posts: 890
28 Aug 2011 02:12 PM
I don't know it just does.
Report Abuse
BCGames is not online. BCGames
Joined: 30 Dec 2010
Total Posts: 8182
28 Aug 2011 02:13 PM
That's impossible. It uses badge service.
Report Abuse
ShoeBox4 is not online. 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
GalaxyWarriors is not online. GalaxyWarriors
Joined: 27 Aug 2011
Total Posts: 36
28 Aug 2011 02:15 PM
PlayerId in test mode is always 0, so it shouldn't work
Report Abuse
BCGames is not online. 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 is not online. ShoeBox4
Joined: 06 Apr 2011
Total Posts: 890
28 Aug 2011 02:18 PM
No.
Report Abuse
BCGames is not online. 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 is not online. ShoeBox4
Joined: 06 Apr 2011
Total Posts: 890
28 Aug 2011 02:20 PM
Oh, right.
Report Abuse
ShoeBox4 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. ShoeBox4
Joined: 06 Apr 2011
Total Posts: 890
28 Aug 2011 02:27 PM
Yes.
Report Abuse
BCGames is not online. 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 is not online. 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
GalaxyWarriors is not online. GalaxyWarriors
Joined: 27 Aug 2011
Total Posts: 36
28 Aug 2011 02:40 PM
Test it on the real online server.
Report Abuse
rangersmash is not online. rangersmash
Joined: 18 Nov 2009
Total Posts: 2891
28 Aug 2011 02:44 PM
[ Content Deleted ]
Report Abuse
ShoeBox4 is not online. 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
GalaxyWarriors is not online. GalaxyWarriors
Joined: 27 Aug 2011
Total Posts: 36
28 Aug 2011 02:49 PM
Why are you making it on gametest? You could lose the whole game
Report Abuse
ShoeBox4 is not online. 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 is not online. 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 is not online. 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
brickbuilder74 is not online. brickbuilder74
Joined: 23 Jun 2008
Total Posts: 8810
28 Aug 2011 05:36 PM
Why'd you add a loop?
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