CodeZenKorean

Specific Message for Transparency

Jan 10th, 2024
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | Gaming | 0 0
  1. -- Script for making a part turn invisible when a specific message is typed in chat
  2.  
  3. local part = script.Parent -- Assuming this script is a child of the part
  4.  
  5. local function onChat(message, player)
  6. -- Check if the message is the specific one
  7. if string.lower(message) == 'PUT YOUR TEXT HERE' then
  8. part.Transparency = 1 -- Replace this part with your code
  9. end
  10. end
  11.  
  12. -- Connect the 'Chatted' event of the player to the 'onChat' function
  13. game.Players.PlayerAdded:Connect(function(player)
  14. player.Chatted:Connect(function(message)
  15. onChat(message, player)
  16. end)
  17. end)
Tags: Roblox
Advertisement
Add Comment
Please, Sign In to add comment