Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how to cheack if a player has a badge and update a gui?

Asked by 1 year ago

i want to make a scrip that check if a player onw a badge and in a gui that appear and dissapear update a frame whit a ? can someone help me?

2 answers

Log in to vote
1
Answered by 1 year ago

You can check if a user owns a badge using BadgeService:UserOwnsBadgeAsync().

local BadgeService = game:GetService("BadgeService")
local BadgeId = 000000000000

-- Check every player that joins if they own the badge
game:GetService("Players").PlayerAdded:Connect(function(player)
    if not BadgeService:UserOwnsBadgeAsync(player.UserId, BadgeId) then
        return -- Cancelling the function early if the player doesn't have the badge
    end

    print(player.Name .. " owns the badge!")
end)
0
sorry i dont specific my question but i want to know how update the gui that i already know same thanks but if you can help me whit that solo_degenme 2 — 1y
0
You can set the visibility of a frame using Frame.Visible DindinYT37 246 — 1y
Ad
Log in to vote
0
Answered by 1 year ago
Edited 1 year ago

Answer this question