Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

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!

2 comments

0

Thank you so much!

0

np ;)

This discussion is preserved as it was. New answers, comments, and votes are closed.