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
 

How to find WHO chatted?

Previous Thread :: Next Thread 
FedoraTime is not online. FedoraTime
Joined: 15 Jul 2012
Total Posts: 996
31 Aug 2013 05:12 PM
I'm trying to find who chatted "join/alpha" so I can change their team color, but I don't know how to find WHO chatted it. I can get WHAT they chatted though...
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
31 Aug 2013 05:14 PM
Post the script.
Report Abuse
FedoraTime is not online. FedoraTime
Joined: 15 Jul 2012
Total Posts: 996
31 Aug 2013 05:24 PM
function onChat(msg, rec)
if string.sub(msg,1,5):lower() == "join/" then
if string.sub(msg, 6):lower() == "alpha" then
-- I need to find who chatted here
end
end
end

function PlayerAdded(newplayer)
newplayer.Chatted:connect(onChat)
end

game.Players.PlayerAdded:connect(PlayerAdded)
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
31 Aug 2013 05:25 PM
game.Players.PlayerAdded:connect(function(plr)
plr.Chatted:connect(function(msg)
-- code here
-- plr is the person who chatted
-- msg is the message that the player posted
end)
end)

"I'm not Singaporian!" - CeaselessSoul
Report Abuse
brinkokevin is not online. brinkokevin
Joined: 25 Jul 2012
Total Posts: 1673
31 Aug 2013 05:31 PM
seems like you are making game like call of robloxia 5 :P join/axis
Report Abuse
SimplyScripts is not online. SimplyScripts
Joined: 18 Aug 2013
Total Posts: 27
31 Aug 2013 06:18 PM
function onChatted(message, player)
if message:sub(1, 10) == "join/alpha" then
player.TeamColor = game.Teams.yourteamhere.TeamColor
end
end

game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(message) onChatted(message, player) end)
end)
Report Abuse
SimplyScripts is not online. SimplyScripts
Joined: 18 Aug 2013
Total Posts: 27
31 Aug 2013 06:20 PM
With the function, its notes what the player said and who said it ("message" and "player")
Report Abuse
SimplyScripts is not online. SimplyScripts
Joined: 18 Aug 2013
Total Posts: 27
31 Aug 2013 06:21 PM


With the function, its notes what the player said and who said it ("message" and "player")
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
31 Aug 2013 06:22 PM
Fire, as in the other thread. The plr IS FOR THE PLAYER THAT CHATTED.

game.Players.PlayerAdded:connect(function(plr)
plr.Chatted:connect(function(msg)
if msg:match("^join/") then
local team = msg:match("^join/(%w+)")
for _,v in pairs(game.Teams:GetTeams()) do
if v.Name:match(team) then
plr.TeamColor = BrickColor(v.TeamColor)
game.Lighting.Sword:Clone().Parent = plr.Backpack
end
end
end
end)
end)
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
31 Aug 2013 06:23 PM
To do the chatted event you must write first what talks, and you use that to find out who talked.
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
31 Aug 2013 06:30 PM
Or this again, in the other thread

game.Players.PlayerAdded:connect(function(plr)
plr.Chatted:connect(function(msg, rec)
if msg:sub(1,5):lower() == "join/" then
if msg:sub(6):lower() == "alpha" then
plr.TeamColor = BrickColor.new("Bright red")
game.Lighting.Sword:clone().Parent = plr.Backpack
end
end
end)
end)
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