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

OfcPedroo. I have a question for you?

Asked by 6 years ago
-- 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

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

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!

0
O woops XD Thanks again PS. I gave you an alphabetical answer to your question! SpinnyWinny 0 — 6y
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! OfcPedroo 396 — 6y
0
Btw I answered you in the other question you had (anti leaking) or what what its name OfcPedroo 396 — 6y
Ad

Answer this question