Advertisement
Dfgjfj

Custom Chat Sound (Client) (LocalScript)

Feb 4th, 2025 (edited)
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. --// You do not need to credit me, i just give it to people :D
  2. local TextChatService = game:GetService("TextChatService")
  3. local Players = game:GetService("Players")
  4. local LocalPlayer = Players.LocalPlayer
  5. local yoursound = "915576050" --// Your Sound Id here
  6. TextChatService.MessageReceived:Connect(function(msg) --// Detect when a message is sent in server, (could use LocalPlayer.Chatted but this is way better)
  7. if msg.TextSource.UserId == LocalPlayer.UserId then --// Check if message sent is from me
  8. local chatsfx = Instance.new("Sound",LocalPlayer) --// Create the sound
  9. chatsfx.SoundId = "rbxassetid://"..yoursound --// Add SoundId
  10. chatsfx:Play() --// Play it
  11. chatsfx.Ended:Connect(function() --// Check once sound ended Destroy sound instance
  12. chatsfx:Destroy()
  13. end)
  14. end
  15. end)
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement