hi, i'm trying to make this script open a frame, but only with players who have a specific badge, i'm desperate with this, i tried many things but it doesn't work, hope someone can help me <3.
screnshoot: https://gyazo.com/5533f700b26c8b3a05904f0443ac4127?token=489b7d84a4f36de57c3ddf9c6ec25aa6
local BadgeService = game:GetService("BadgeService")
local Players = game:GetService("Players")
local BadgeId = 2124596127
game:GetService("Players").PlayerAdded:Connect(function(player)
local player = Players.LocalPlayer
local hasBadge = true
if BadgeService:UserHasBadge(player, BadgeId) then
end
script.Parent.MouseButton1Click:Connect(function()
if hasBadge then
script.Parent.Parent.Group.Visible = false
script.Parent.Parent.Group.BackgroundTransparency = 1
script.Parent.Parent.Normal.Visible = false
script.Parent.Parent.Normal.BackgroundTransparency = 1
script.Parent.Parent.Villanos.Visible = false
script.Parent.Parent.Villanos.BackgroundTransparency = 1
script.Parent.Parent.BadgeFrame.BackgroundTransparency = 0
script.Parent.Parent.BadgeFrame.Visible = true
end
end)
end)

1 comment
omg tysm!