Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --// You do not need to credit me, i just give it to people :D
- local TextChatService = game:GetService("TextChatService")
- local Players = game:GetService("Players")
- local LocalPlayer = Players.LocalPlayer
- local yoursound = "915576050" --// Your Sound Id here
- TextChatService.MessageReceived:Connect(function(msg) --// Detect when a message is sent in server, (could use LocalPlayer.Chatted but this is way better)
- if msg.TextSource.UserId == LocalPlayer.UserId then --// Check if message sent is from me
- local chatsfx = Instance.new("Sound",LocalPlayer) --// Create the sound
- chatsfx.SoundId = "rbxassetid://"..yoursound --// Add SoundId
- chatsfx:Play() --// Play it
- chatsfx.Ended:Connect(function() --// Check once sound ended Destroy sound instance
- chatsfx:Destroy()
- end)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement