local B1 = (IDhidden) game.Players.PlayerAdded:connect(function(p) if game:GetService("BadgeService"):UserHasBadge(p.userId, B1) then game.Players.PlayerAdded.PlayerGui.SG.SF.B1.Check.Visible = true end end)
Heres the StarterGui with the script (above) : http://imgur.com/xrJgkme
I own the badge, but the image doesn't turn visible when i play the game and i don't know why
You were trying to use a event to access a Player's Gui. You can not do that, you already have the variable for the new joined player though "p".
local B1 = (IDhidden) game.Players.PlayerAdded:connect(function(p) if game:GetService("BadgeService"):UserHasBadge(p.userId, B1) then p:WaitForChild("PlayerGui").SG.SF.B1.Check.Visible = true --Just remove up to that event, and make sure you have some functions to protect the script from breaking, such as WaitForChild() end end)
Alright, I just saw the image. So you know, PlayerAdded events WILL NOT work as intended in StarterGui or Backpack! They will not!
Here, I will fix up the code once more.
local B1 = (IDhidden) if game:GetService("BadgeService"):UserHasBadge(script.Parent.Parent.userId, B1) then script.Parent:WaitForChild("SG").SF.B1.Check.Visible = true --Since the script is in PlayerGui, just do this... and have some protection from the script breaking... WaitForChild(). end