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

Why doesn't the GUI appear if the player owns the badge?

Asked by 9 years ago

Hey guys,

I've been wondering what I am missing in this script!

BadgeId = 160235804

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

game.Workspace.ChildAdded:connect(respawned)

I don't see a problem with it but it should have worked. If anyone sees a problem I've overlooked, please say!

Cheers,

Michael

0
Is this in a LocalScript? woodengop 1134 — 9y
0
No. If it needs to be though, please say! (Also, of I need to change any of the code) Michael007800 144 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

Forget it! :D

I just tried to over-complicate things. This works just the same!

if script.Parent.Parent.Parent.Parent.Parent.Parent.leaderstats.Level.Value >= 10
then
    script.Parent.Parent.Spawn.Visible = true
    script.Parent.Parent.Parent.OwnedBikes.Bike3.Visible = true
else
    script.Parent.Parent.Spawn.Visible = false
end
Ad

Answer this question