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

Help with Badges with Roblox Servers?

Asked by 10 years ago

Image won't change if a player has a badge, how come?

game.Players.PlayerAdded:connect(function(player)
    repeat wait() until player.Character
    -- Welcome Badge --
    while wait() do
        if game:GetService('BadgeService'):UserHasBadge(player.userId, 193507707)then
            script.Parent.Badge1.Images.Badge1.Image = "rbxassetid://193507669"
        else
            script.Parent.Badge1.Images.Badge1.Image = "rbxassetid://193930788"
        end
    end
end)

1 answer

Log in to vote
-1
Answered by 10 years ago

What I think is happening is the script is loading before the player even can say "Hi I'm here" so what I recommend adding is after line one do: repeat wait() until player.Character

that way it will wait for the player's character to finish loading then it will execute the while loop.

Another thing is I recommend putting a stop to the while loop once your done with it by adding a "break"

0
i cant add break, cause thers multiple badges inside it to check for. NinjoOnline 1146 — 10y
0
and still dosent work, theres no errors, but the image to the gui dosent change, I eddited my answer with a full thing NinjoOnline 1146 — 10y
Ad

Answer this question