I am trying to make the changes from this badge check script local.
the script works, but the changes aren’t local. How would I do this?
local BadgeService = game:GetService("BadgeService")
local Players = game:GetService("Players")
local badgeID = script.Parent.BadgeId.Value
local function onPlayerAdded(player)
local success, hasBadge = pcall(function()
return BadgeService:UserHasBadgeAsync(player.UserId, badgeID)
end)
if not success then
return
end
if hasBadge then
script.Parent.BrickColor = BrickColor.new("Bright green")
end
end
Players.PlayerAdded:Connect(onPlayerAdded)