Advertisement
Guest User

Untitled

a guest
Mar 25th, 2020
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.61 KB | None | 0 0
  1. local BadgeService = game:GetService("BadgeService")
  2. local BadgeId = --// Badge Asset Id
  3. local Players = game:GetService("Players")
  4.  
  5. local Part = script.Parent
  6.  
  7. Part.Touched:Connect(function(Hit)
  8.     local Humanoid = Hit.Parent:FindFirstChildOfClass("Humanoid")
  9.     if (Humanoid) then
  10.         local Player = Players:GetPlayerFromCharacter(Hit.Parent)
  11.         if (Player) then
  12.             if (BadgeService:UserHasBadge(Player.UserId, BadgeId) then
  13.                 print(Player.Name.." Has Badge")
  14.             else
  15.                 Humanoid:TakeDamage(Humanoid.Health)  
  16.             end
  17.         end
  18.     end
  19. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement