The problem is that badgeservice uses a serverscript not a local script. Something you can do however is to make a server script to check if the player meets the requirements, Then send a fireclient request from a remoteevent for the local script to change the things for that player only, Just keep in mind that the local script should be parented to starterplayer scripts
A example is like
Server Script:
1 | game.Players.PlayerAdded:Connect( function (Plr) |
2 | local UserId = Plr.UserId |
3 | local BadgeService = game:GetService( "BadgeService" ) |
5 | if BadgeService:UserHasBadgeAsync(UserId, 2124700001 ) then |
6 | game.ReplicatedStorage.Blahblah:FireClient(Plr) |
Local script: (parented as parent being its ancestor)
1 | game.ReplicatedStorage.Blahblah.OnClientEvent:Connect( function () |
2 | workspace.everything.tom 2. tom 3. BrickColor = BrickColor.new( "Sea green" ) |
hope this helped