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: Check Ownership Of.

Previous Thread :: Next Thread 
evilishnessII is not online. evilishnessII
Joined: 26 Mar 2011
Total Posts: 10275
29 May 2012 05:59 PM
In a script, how would I check if someone has a certain badge? I know others have done it, but I don't want to have to edit a free model.
Report Abuse
magicdsi is not online. magicdsi
Joined: 14 Feb 2010
Total Posts: 276
29 May 2012 06:00 PM
PlayerHasBadge, search it in wiki im to lazy to get you a link
Report Abuse
evilishnessII is not online. evilishnessII
Joined: 26 Mar 2011
Total Posts: 10275
29 May 2012 06:00 PM
Thanks. :)
Report Abuse
evilishnessII is not online. evilishnessII
Joined: 26 Mar 2011
Total Posts: 10275
30 May 2012 02:56 PM
Ok, I have another question.

If I put

PlayerHasBadge BadgeID ~= [BADGEID]

And there was an ID inplace of [BADGEID], would it check if you have anything BUT this item?
Report Abuse
velibor is not online. velibor
Joined: 24 Nov 2009
Total Posts: 1003
30 May 2012 03:25 PM
BadgeId = #

game.Players.PlayerAdded:connect(function(p)
if game:GetService("BadgeService"):UserHasBadge(p.userId, BadgeId) then
print("The user has this badge")
else
print("The user does not have this badge")
end
end)

Other said. This script will test or a Player has the Badge. If he has it will return a True value.

Just like :findFirstChild() that will also return a boolean.

Velibor
Report Abuse
evilishnessII is not online. evilishnessII
Joined: 26 Mar 2011
Total Posts: 10275
30 May 2012 09:58 PM
Not what I asked, and I already saw that on the Wiki.

Thanks anyway. :\
Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
30 May 2012 10:20 PM
You can use the UserHasBadge method. It accepts two arguments, userId and assetId. Both must be integers.

The first is the id of the asset, the second is the id of the user.

If the user with the id userId owns the asset with the id assetId, the method will return true. Otherwise, it will return false.
Report Abuse
Trapper4O77 is not online. Trapper4O77
Joined: 03 Aug 2011
Total Posts: 5648
31 May 2012 10:49 AM
^
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