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

I need help. How do I make it play an audio if somebody says a certain thing on the right team?

Asked by 6 years ago
Edited 6 years ago

So I have no idea how to do this but all I need is that when somebody says something on a certain team it plays an audio such as.

Red team member says: Hi (It then plays an audio from the catalog that says "Hi")

NOT

If it says any other team colour / name if you get what I mean.

Thanks In advance Credit will go to the game Im making if somebody could help me with this.

1 answer

Log in to vote
0
Answered by
OfcPedroo 396 Moderation Voter
6 years ago

Try the following!

--Variables
correctTalk = "" --Inside of those "", write what the player would have to say so the action would happen. E.G: "Hey this is the correct talk!"

correctTeam = "" --Inside put the correct team's name, after "game.Teams." E.G: game.Teams.ExampleTeam

game.Players.PlayerAdded:connect(function(player) --Get player.
    player.Chatted:connect(function(msg) --Get player's message if he talks in chat.
            if msg == correctTalk then
            if player.Team == correctTeam then
                --Code should go here, try out with a print!
                print("Everything went fine!")
            end
        end
    end)
end)

If this works, please mark as the solution!

As always, good scripting!

0
Thank you so much! SpinnyWinny 0 — 6y
0
np ;) OfcPedroo 396 — 6y
Ad

Answer this question