Advertisement
Guest User

Chat door

a guest
May 24th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. script:local message = "dog man" --- change this to whatever you want your trigger to be
  2. local door = script.Parent
  3. function onChatted(msg, recipient, speaker)
  4. local source = string.lower(speaker.Name)
  5. msg = string.lower(msg)
  6. if (msg == message) then
  7. door.CanCollide = false
  8. for i = 1, 9 do
  9. door.Transparency = door.Transparency + 0.1
  10. wait()
  11. end
  12. wait(5)
  13. for i = 1, 9 do
  14. door.Transparency = door.Transparency - 0.1
  15. wait()
  16. end
  17. door.CanCollide = true
  18. end
  19. end
  20.  
  21. function onPlayerEntered(newPlayer)
  22. newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end)
  23. end
  24.  
  25. game.Players.PlayerAdded:connect(onPlayerEntered)
  26.  
  27. Note: Insert script into the object you want.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement