What do you want to achieve? I want to do a frame with all game badges, if a player earn one then the frame with the badge turn green.
What is the issue? i tried to do a script for all (for avoid too many while wait() do), but it is not working (it is a localscript). For more information ask me
while wait(10) do
for i,v in pairs(script.Parent:GetChildren()) do
if v:FindFirstChildOfClass("Frame") then
local BadgeService = game:GetService("BadgeService")
local id = script.Parent[v.Name].badgeID.Value
local plr = game.Players.LocalPlayer
if BadgeService:UserHasBadgeAsync(plr.UserId, id) then
script.Parent[v.Name].BackgroundColor3 = Color3.fromRGB(85, 255, 0)
script.Parent[v.Name].LayoutOrder = -1
end
end
end
end