This script has to check every two seconds if a player have the badge, if not the X stays visible. But if they do the X goes away. This script works normaly but in this game I use filtering enabled and made the script localscript version. I tried a normal script but that even didn't work. Now it is Playergui > Gui > frame > frame >... > localscript. But local scripts haven't acces to badge service. And when we do a normal script is it not working because the filtering enabled. We also tried with remote event but still not working.
b = game:GetService("BadgeService")
local player = game.Players.LocalPlayer
while wait (2) do
if b:UserHasBadge(player.userId, 9999999) then --badge id
script.Parent.Image = "http://www.roblox.com/asset/?id="
else
script.Parent.Image = "http://www.roblox.com/asset/?id=47604833"
end
end
So my second method:
this is the remote version This script is inside the playergui, frame etc..
wait(2)
while wait (2) do
if game.Workspace.BadgeMothers.BadgeHad01:FireServer() then
script.Parent.Image = "http://www.roblox.com/asset/?id="
else
script.Parent.Image = "http://www.roblox.com/asset/?id=47604833"
end
end
and this script its the event script inside the ServerScriptStorage:
local event = Instance.new("RemoteEvent")
event.Parent = game.Workspace.BadgeMothers
event.Name = "BadgeHad01"
event.OnServerEvent:connect(function(player)
local b = game:GetService("BadgeService")
b:UserHasBadge(player.userId, 99999999)
end)
thank you

2 comments
Why do you need to check every two seconds? When you give out the badge just fire a remote to update the client?
Its for a badge list wait I will put the remote version here too