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: Does anyone know what's wrong with this?

Previous Thread :: Next Thread 
Destructias is not online. Destructias
Joined: 12 Dec 2009
Total Posts: 340
22 Dec 2013 10:15 AM
game.Players.PlayerAdded:connect(function(p)
if game:GetService("BadgeService"):UserHasBadge(p.userId,106476791) then
script.Parent.BackgroundColor3 = Color3.new(0, 255, 0)
end)
Report Abuse
Robloxmaster2137 is not online. Robloxmaster2137
Joined: 30 Jan 2011
Total Posts: 281
22 Dec 2013 10:19 AM
One thing is that Color3.new is in decimal, so you need to divide each by 255! (except 0 obviously).
Also, you forgot an end to end the if statement.

game.Players.PlayerAdded:connect(function(p)
if game:GetService("BadgeService"):UserHasBadge(p.userId,106476791) then
script.Parent.BackgroundColor3 = Color3.new(0, 255/255, 0)
end
end)
Report Abuse
Digitalizing is not online. Digitalizing
Joined: 13 Aug 2013
Total Posts: 1057
22 Dec 2013 10:20 AM
why not zero? dividing by zero is *perfectly* fine.
Report Abuse
Destructias is not online. Destructias
Joined: 12 Dec 2009
Total Posts: 340
22 Dec 2013 10:20 AM
Alright, thanks for the help!
Report Abuse
Robloxmaster2137 is not online. Robloxmaster2137
Joined: 30 Jan 2011
Total Posts: 281
22 Dec 2013 10:24 AM
@Digitalizing
Yeah, I know, but it isn't needed.
Report Abuse
Destructias is not online. Destructias
Joined: 12 Dec 2009
Total Posts: 340
22 Dec 2013 10:32 AM
Hmm strange it still doesn't work. It's supposed to be a red TextLabel that turns green when you own a certain badge.
Report Abuse
Destructias is not online. Destructias
Joined: 12 Dec 2009
Total Posts: 340
22 Dec 2013 10:33 AM
However, it stays red even though I own the badge.
Report Abuse
Robloxmaster2137 is not online. Robloxmaster2137
Joined: 30 Jan 2011
Total Posts: 281
22 Dec 2013 10:39 AM
Are you testing it on "Test" or online "Play"?
Report Abuse
Destructias is not online. Destructias
Joined: 12 Dec 2009
Total Posts: 340
22 Dec 2013 10:41 AM
Tried it out online.
Report Abuse
Destructias is not online. Destructias
Joined: 12 Dec 2009
Total Posts: 340
22 Dec 2013 10:42 AM
Output is also empty when I try it in Test mode.

In Play mode nothing happens either.
Report Abuse
Destructias is not online. Destructias
Joined: 12 Dec 2009
Total Posts: 340
22 Dec 2013 11:10 AM
Please?
Report Abuse
Robloxmaster2137 is not online. Robloxmaster2137
Joined: 30 Jan 2011
Total Posts: 281
22 Dec 2013 11:14 AM
I'm not sure.
Report Abuse
Destructias is not online. Destructias
Joined: 12 Dec 2009
Total Posts: 340
22 Dec 2013 12:17 PM
bump
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