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
 

Add a player's name to value?

Previous Thread :: Next Thread 
Alexrocksdude is not online. Alexrocksdude
Joined: 19 Jan 2011
Total Posts: 3828
25 Aug 2013 11:30 AM
How would I add the person who chatted's name here:

-----------chat saver--------------
game.Players.PlayerAdded:connect(function(chat)
chat.Chatted:connect(function(chat)
local s = chat
local v = Instance.new("StringValue")
v.Value = s
v.Parent = workspace.Chats
end) end)
-----------chat saver--------------
Report Abuse
Alexrocksdude is not online. Alexrocksdude
Joined: 19 Jan 2011
Total Posts: 3828
25 Aug 2013 11:38 AM
Bump.
Report Abuse
expressmyself is not online. expressmyself
Joined: 19 Apr 2011
Total Posts: 1768
25 Aug 2013 11:40 AM
game.Players.PlayerAdded:connect(function(player)
chat.Chatted:connect(function(chat)
local s = player.Name .. " has chatted: " .. chat
local v = Instance.new("StringValue")
v.Value = s
v.Parent = workspace.Chats
end)
end)
Report Abuse
jonman111 is not online. jonman111
Joined: 26 May 2010
Total Posts: 35
25 Aug 2013 11:40 AM
Two anonymous functions inside eachother, both with the same variable "chat"
Won't that confuse the script?
Report Abuse
zars15 is not online. zars15
Joined: 10 Nov 2008
Total Posts: 9999
25 Aug 2013 11:42 AM
@jon. No, he simply messed it up.


game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(chat)
local s = player.Name .. " has chatted: " .. chat
local v = Instance.new("StringValue")
v.Value = s
v.Parent = workspace.Chats
end)
end)
Report Abuse
Alexrocksdude is not online. Alexrocksdude
Joined: 19 Jan 2011
Total Posts: 3828
25 Aug 2013 11:51 AM
Thanks, all I really needed was this though:
local s = player.Name .. " has chatted: " .. chat
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