Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- || 📜 AUTHOR: @4zx16 || BADGE ONLY GUI
- ]]
- local BadgeService = game:GetService("BadgeService")
- local PlayerService = game:GetService("Players").LocalPlayer
- local BADGE_ID = 0
- --[[
- ---------------------------------------------------------------------
- VARIABLES:
- ----------------------------------------------------------------------
- --]]
- local function OpenOrClose()
- local main = script.Parent.Parent.main
- if main.Visible == true then
- main.Visible = false
- else
- main.Visible = true
- end
- end
- ----- IF PLAYER HAS BADGE -------------------------
- script.Parent.MouseButton1Click:Connect(function()
- if BadgeService:UserHasBadgeAsync(PlayerService.UserId, BADGE_ID) then
- OpenOrClose()
- ------ IF PLAYER DON'T HAVE BADGE ------------------
- elseif not BadgeService:UserHasBadgeAsync(PlayerService.UserId, BADGE_ID) then
- PlayerService:Kick(PlayerService.Name.. " doesn't own required badge")
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement