WolfGamesProgrammer

Teamdoor

Nov 6th, 2024
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.53 KB | Source Code | 0 0
  1. local teamName = "Police" -- название команды, которая может пройти через тимдур
  2.  
  3.  
  4. function OnTouched(hit)
  5.     local human = hit.Parent:FindFirstChild("Humanoid")
  6.     if human then
  7.         local player = game.Players:GetPlayerFromCharacter(hit.Parent)
  8.         if player then
  9.             if player.Team == game.Teams[teamName] then
  10.                 script.Parent.CanCollide = false
  11.                 script.Parent.CanQuery = false
  12.                 wait(2)
  13.                 script.Parent.CanCollide = true
  14.             end
  15.         end
  16.     end
  17. end
  18. script.Parent.Touched:Connect(OnTouched)
Advertisement
Add Comment
Please, Sign In to add comment