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:

game.Players.PlayerAdded:Connect(function(plr) -- Player Added Event
    plr.Chatted:Connect(function(msg) -- Chatted Event
        local sound = Instance.new("Sound") -- Make New Sound
        sound.Parent = workspace -- Parent Of The Sound
        sound.SoundId = "" -- Sound Id Make Sure To Put rbxassetid:// Or It Won't Work!
        sound.Name = "IDK" -- Sound Name
        sound:Play() -- Play The Sound
        wait(sound.TimeLength) -- Wait Until The Song Finished
        sound:Stop() -- Stop It Playing
        sound:remove() -- Remove It
    end) -- End The Function
end) -- 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
game.Players.PlayerAdded:Connect(function(plr)
    plr.Chatted:Connect(function(msg)
        local sound = Instance.new("Sound")
        sound.Parent = workspace 
        sound.SoundId = "" -- Sound Id
        sound.Name = "IDK" -- Sound Name
        sound:Play()
        wait(sound.TimeLength)
        sound:Stop()
        sound:Destroy()
    end)
end)

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