generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Chatted Script

Previous Thread :: Next Thread 
swatteam773 is not online. swatteam773
Joined: 01 May 2009
Total Posts: 321
03 Nov 2012 03:59 PM
function onChatted(msg, recipent, speaker)
if msg == "Yes sir" then
script["Yes sir"]:play()
end
end
function onPlayerEntered(newPlayer)
newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end)
end

game.Players.ChildAdded:connect(onPlayerEntered)

How Would I Make It So You Can Say Other Things Becides "Yes sir" to make the sound "Yes sir" plays. I tried this, which will not work:

if msg == "Yes sir","Sir yes sir" then

Although that doesnt seem to work, Please help.
Report Abuse
blackboy167thst is not online. blackboy167thst
Joined: 22 Jul 2011
Total Posts: 2468
03 Nov 2012 04:01 PM
local chats = { "Yes sir", "Poop", "Lol", "InsertMessageHere" }

function onChatted(msg)
for _,v in pairs(chats) do
if msg == v then
script["Yes sir"]:play()
end
end
end

Report Abuse
swatteam773 is not online. swatteam773
Joined: 01 May 2009
Total Posts: 321
03 Nov 2012 04:05 PM
It doesnt seem to be working.
Report Abuse
blackboy167thst is not online. blackboy167thst
Joined: 22 Jul 2011
Total Posts: 2468
03 Nov 2012 04:07 PM
local chats = { "Yes sir", "Poop", "Lol", "InsertMessageHere" }
game.Players.PlayerAdded:connect(function(p)
p.Chatted:connect(function(msg)
for _,v in pairs(chats) do
if msg == v then
script["Yes sir"]:play()
end
end
end)
end)
Report Abuse
swatteam773 is not online. swatteam773
Joined: 01 May 2009
Total Posts: 321
03 Nov 2012 04:09 PM
Got, it thanks
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image