Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

How do I make it so when say something in chat a sound plays?

Asked by 4 years ago
Edited 4 years ago

I want to make it so a sound plays when you say something in chat, how would I do that?

0
Not a request site. JailBreaker_13 350 — 4y
0
@JailBreaker_13 I recommend you look at the guidelines again, this falls under concept request because he is not asking for a script, only an explanation. SteamG00B 1633 — 4y

2 answers

Log in to vote
-1
Answered by 4 years ago
Edited 4 years ago

This Script Is Server Sided Meaning That It Will Work For Every Client In Game Not Just For The Local Client:

01game.Players.PlayerAdded:Connect(function(plr) -- Player Added Event
02    plr.Chatted:Connect(function(msg) -- Chatted Event
03        local sound = Instance.new("Sound") -- Make New Sound
04        sound.Parent = workspace -- Parent Of The Sound
05        sound.SoundId = "" -- Sound Id Make Sure To Put rbxassetid:// Or It Won't Work!
06        sound.Name = "IDK" -- Sound Name
07        sound:Play() -- Play The Sound
08        wait(sound.TimeLength) -- Wait Until The Song Finished
09        sound:Stop() -- Stop It Playing
10        sound:remove() -- Remove It
11    end) -- End The Function
12end) -- End The Function

I Hope I Was More Clear Here Sorry That I Didn't Explain That Well I Was On My Phone.

0
If you give an answer, you have to explain.  SteamG00B 1633 — 4y
Ad
Log in to vote
-1
Answered by 4 years ago
01game.Players.PlayerAdded:Connect(function(plr)
02    plr.Chatted:Connect(function(msg)
03        local sound = Instance.new("Sound")
04        sound.Parent = workspace
05        sound.SoundId = "" -- Sound Id
06        sound.Name = "IDK" -- Sound Name
07        sound:Play()
08        wait(sound.TimeLength)
09        sound:Stop()
10        sound:Destroy()
11    end)
12end)

That is the serverscript

0
You can't copy and paste someone's answer to try to farm karma. The only case when you should be doing that is if the other person didn't provide an explanation with their post, yet you also did not provide an explanation. SteamG00B 1633 — 4y

Answer this question