basically what I wanted to do is a part that is red, change its color to green when the player joins and has an especific badge
Just like the RB Battles badges room
Check if the player owns the badge you want with :UserOwnsBadgeAsync and then change the color (you may need a local script and remote event since only the player should see the color change)
Server:
local BS = game:GetService('BadgeService')
local BadgeID = --Put your badge Id here
game.Players.PlayerAdded:Connect(function(plr)
if BS:UserOwnsBadgeAsync(plr.UserId,BadgeID) then
game.ReplicatedStorage.ChangePartColor:FireClient(plr)
end
end)
Client:
local part = -- Put the part you want to change here
game.ReplicatedStorage.ChangePartColor.OnClientEvent:Connect(function()
part.BrickColor = BrickColor.new('Forest Green')
end)