I want to make a VIP door only to be passed by those with a specific badge.
Is this the same as a gamepass door? just with the badge id?
(the heck is with the title rules xD)
I want to make a VIP door only to be passed by those with a specific badge.
Is this the same as a gamepass door? just with the badge id?
(the heck is with the title rules xD)
This is pretty easy, it's the same as GamepassService but just with BadgeService.
local Door = game.Workspace.VipBadgeDoor --or you could just do script.Parent
function onTouched(hit)
local human = hit.Parent:findFirstChild("Humanoid")
if (human ~= nil ) then
if game:GetService("BadgeService"):UserHasBadge(game.Players[human.Parent.Name].userId, script.Parent.BadgeID.Value) ~= false then
Door.Transparency = 0.5 --you can change it if you'd like to
Door.CanCollide = false --player can walk through the door
wait(4) --the door will be open for 4 seconds
Door.CanCollide = true --player cant walk through the door
end
end
end
script.Parent.Touched:connect(onTouched)
Haven't tested this, but it should probably work.
Note: Make a IntValue in the door and name it BadgeID (or whatever you want to, you just have to change it in the script).
And for the door you can just make a big brick or something.
Just use the Copy to clipboard option on this website if you want to paste it in.
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
where is your code? we need to know what you have so far in order to answer!!!