Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

GUI remove with Badge?

Asked by 8 years ago

Hey guys!

I need a script that removes a GUI if the player already owns a badge! If anyone can see a fix for this, that would be great!

BadgeId = 160235804

game.Players.PlayerAdded:connect(function(p)
if GamePassService:PlayerHasPass(player, passid) then
script.Parent.Parent.Spawn.Visible = true
else
script.Parent:remove()
wait(.01)
    end
end)

game.Workspace.ChildAdded:connect(respawned)

Cheers,

Michael

1 answer

Log in to vote
1
Answered by
iNicklas 215 Moderation Voter
8 years ago
BadgeId = 160235804

game.Players.PlayerAdded:connect(function(p)
if game:GetService("BadgeService"):UserHasBadge(p.userId, BadgeId) then
script.Parent.Parent.Spawn.Visible = true
else
script.Parent:remove()
wait(.01)
    end
end)

game.Workspace.ChildAdded:connect(respawned)

0
Cheers again, thanks! Michael007800 144 — 8y
Ad

Answer this question