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

OfcPedroo. I have a question for you?

-- Mobile Task Force / Security Department Chatvoice
--Variables
	correctTalk = "RM" 
	correctTeam = "Mobile Task Force" 
--Code Below	 
	game.Players.PlayerAdded:connect(function(player) 
	    player.Chatted:connect(function(msg)
	            if msg == correctTalk then
	            if player.Team == correctTeam then
	               print("MsgDeliverd")
	               game.Workspace.RM:Play()
	                print("Everything went fine!")
	            end
	        end
	    end)
	end)
	
	-- Made by SpinnyWinny
	-- Credit to, OfcPedroo

The script in all its glory. But I got a few questions for you about it

A) How can I make it so the player emits the sound not the game B) Why doesnt it work now ;-;

1 answer

✓ Accepted answer

I'll help you again!

You want the player to play the sound, right? Then you have to copy the sound to its head. I also added debugging options, to make sure the team you put exists. Also fixed the correctTeam path, because you forgot to add "game.Teams" in it.

-- Mobile Task Force / Security Department Chatvoice

--Variables
correctTalk = "RM"
correctTeam = game.Teams["Mobile Task Force"] --You had to put behind game.Teams. I fixed it for you, but still, make sure that team exists.

--Code Below
game.Players.PlayerAdded:connect(function(player)
	repeat wait() until player.Character
--Some debugging options
	if correctTeam == nil then --If Mobile Task Force isn't a team, that warn will show up in the output.
		warn("Debugging option: "..correctTeam.." doesn't exist. Make sure you didn't mistake in the path.")
	end
	local clone = game.Workspace.RM:clone()
	clone.Parent = player.Character
	player.Chatted:connect(function(msg)
		if msg == correctTalk then
                	if player.Team == correctTeam then
				print("MsgDeliverd")
				player.Character.Head.RM:Play()
				print("Everything went fine!")
                	end
		end
	end)
end)

-- Made by SpinnyWinny
-- Credit to OfcPedroo

If that works, please mark as the solution!!!

As always, good scripting!

3 comments

0

O woops XD Thanks again PS. I gave you an alphabetical answer to your question!

0

Yeah, I had to remove it, moderators were trying to take off my question because there wasn't any questions, so i deleted the question, but thanks anyways!

0

Btw I answered you in the other question you had (anti leaking) or what what its name

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