local BadgeService = game:GetService("BadgeService")
local BadgeId = 2124909460
local player = game.Players.LocalPlayer
while wait(8) do
if BadgeService:UserHasBadge(player.UserId, BadgeId) then
script.Parent.Visible = true
script.Parent.Parent.cross.Visible = false
else
script.Parent.Parent.cross.Visible = true
script.Parent.Visible = false
end
end
local Players = game:GetService("Players")
local Part = script.Parent
local BadgeId = 0 -- Your badge id here
local UsersToNotGiveBadge = {1115747243} -- Put the user id's that you don't want it to give the bagde to here
Part.Touched:Connect(function(Hit)
if Players:GetPlayerFromCharacter(Hit.Parent) then
local Player = Players:GetPlayerFromCharacter(Hit.Parent)
if table.find(UsersToNotGiveBadge, Player.User) then
return
end
local Success, HasBadge = pcall(function()
return BadgeService:UserHasBadgeAsync(Player.UserId, BadgeId)
end)
if not HasBadge then
task.wait(1)
local AwardSuccess, Result = pcall(function()
return BadgeService:AwardBadge(Player.UserId, BadgeId)
end)
end
end
end)