I want to make a quick system where if a player has a badge, a part turns green on their client. However I’ve already tried multiple solutions such as trying to make the server detect it and then it’ll be sent back to the client, but it doesn’t work. I know I can’t use local scripts and I tried making it a sever script but I really don’t know where to go from there either.
local BadgeService = game:GetService('BadgeService')
local Players = game:GetService('Players')
local Player = Players.LocalPlayer
if BadgeService:UserHasBadgeAsync(Player.UserId, PlaceHolderID) then
script.Parent.Color = Color3.new(91, 154, 76)
end
You would just need to check if the player has the badge on the server. I’m assuming you want it to change color when the player joins the game, so you would use PlayerAdded, then check if they have the badge and use FireClient to the tell the client to change the color of the part.
First of all make the check on a server script and then send a remote event to the client. Once the client has received the remote event use Color3.fromRGB() instead. Why should the check be on the server you may ask and that is because else a player can hack it and get that color without the badge