of     1   

fisherman94
#35100674Friday, October 08, 2010 9:10 PM GMT

I know you can check to see if a player owns a particular item. I thought I had the right bit of code, but it's not working. So can anyone give my the method you are supposed to use?:3
crazypotato4
#35100828Friday, October 08, 2010 9:12 PM GMT

game:GetService("BadgeService"):UserHasBadge(userId, assetId) I think, I've never used BadgeService before, but I hear that you can check if a player owns anything with it.
Kuroki
#35100877Friday, October 08, 2010 9:13 PM GMT

I only know the particular code to check it: if game:GetService("BadgeService").UserHasBadge(player.Id, ID OF THE BADGE) then --do stuff
Kuroki
#35100926Friday, October 08, 2010 9:14 PM GMT

Huzzah! I only forggot to use colons instead of a period dot!
Ulla42
#35101019Friday, October 08, 2010 9:15 PM GMT

Hm, I never thought the badge checker would check any form of ownership. Thanks, I might try experimenting with that.
fisherman94
#35101056Friday, October 08, 2010 9:15 PM GMT

That's exactly it, thanks!:D The line I has had :UseHasAsset, not Badge. Works now, thanks a ton;D
fisherman94
#35101214Friday, October 08, 2010 9:17 PM GMT

@kuroki There is a property of player that contains the Id?:o That would be helpful; I was trying to use string manipulation to get it off the CharacterAppearance:P @ulla Yup! Got the idea from gamer101. You don't have to wear his VIP shirt into a game, so I searched the SH for an explanation. Very nifty little bit of code!:D
AgentFirefox
Top 100 Poster
#35102599Friday, October 08, 2010 9:34 PM GMT

@fisherman If you look at Player in the object browser, you will see a userId property. ^_^
fisherman94
#35102825Friday, October 08, 2010 9:37 PM GMT

@agent Oh:| *facepalm*
fisherman94
#35106155Friday, October 08, 2010 10:20 PM GMT

I ran into a problem. It works, but it works too well. It does the stuff I want it to whether the player owns the item or not:c Here is the script: for i, v in pairs(children) do if v:findFirstChild("Id") ~= nil then if game:GetService("BadgeService"):UserHasBadge(game.Players:GetPlayerFromCharacter(player).userId, v:findFirstChild("Id").Value) ~= nil then v:findFirstChild("ClickMe").Active = true end end end
fisherman94
#35106846Friday, October 08, 2010 10:29 PM GMT

Halp pl0x?...:\
crazypotato4
#35107004Friday, October 08, 2010 10:31 PM GMT

could we see more of the script?
fisherman94
#35107134Friday, October 08, 2010 10:33 PM GMT

Sure, but that's the only part dealing with what is messing up:3 function onSpawn(player) if player:IsA("Model") and game.Players:GetPlayerFromCharacter(player) ~= nil then repeat wait(.1) until game.Players:GetPlayerFromCharacter(player).Character ~= nil wait(1) dontHarm = Instance.new("BoolValue") dontHarm.Name = "dontHarm" dontHarm.Parent = player gui = script.powerSelection:clone() gui.Parent = game.Players:GetPlayerFromCharacter(player).PlayerGui.mainGui children = gui.eggChoices:GetChildren() for i, v in pairs(children) do if v:findFirstChild("Id") ~= nil then if game:GetService("BadgeService"):UserHasBadge(game.Players:GetPlayerFromCharacter(player).userId, v:findFirstChild("Id").Value) ~= nil then v:findFirstChild("ClickMe").Active = true end end end end end game.Workspace.ChildAdded:connect(onSpawn)

    of     1