Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --this script was made by me and DOES WORK! just enter the badge ID into the thing that says "BadgeID"
- --btw you can also change the text on the thing that says text.
- door = script.Parent
- badgeholder = door.Parent.BadgeID
- debounce = false
- function find(userid, badgeid)
- if game:GetService("BadgeService"):UserHasBadge(userid, badgeid) then
- return true
- else
- return false
- end
- end
- function onTouched(hit)
- if (hit.Parent:FindFirstChild("Humanoid") ~= nil) then
- local p = game.Players:GetPlayerFromCharacter(hit.Parent)
- if (p ~= nil) then
- if (find(p.userId, badgeholder.Value)) and (debounce == false) then
- door.Transparency = 0.8
- door.CanCollide = false
- wait(0.3)
- door.Transparency = 0.5
- door.CanCollide = true
- elseif (find(p.userId, badgeholder.Value) == false) then
- hit.Parent.Humanoid.Health = 0
- end
- end
- end
- end
- door.Touched:connect(onTouched)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement