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: chat help

Previous Thread :: Next Thread 
Lo202 is not online. Lo202
Joined: 31 Jan 2013
Total Posts: 579
10 Jul 2014 05:13 AM
getservice = game:GetService("MarketplaceService")

function onChatted(msg, recipent, speaker)
if (string.sub(msg, 1,5) == "info/") then
local info = string.sub(msg, 5)
local asset = getservice:GetProductInfo(info)
message = Instance.new("Message", game.Workspace)
message.Text = asset.Name.." : "..asset.Description
end
end
function onEntered(newPlayer)
newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end)
end


Report Abuse
cheatmaster18 is not online. cheatmaster18
Joined: 29 Oct 2010
Total Posts: 1871
10 Jul 2014 05:29 AM
Is that the whole script?
Report Abuse
Lo202 is not online. Lo202
Joined: 31 Jan 2013
Total Posts: 579
10 Jul 2014 05:31 AM
Yes
Report Abuse
Lo202 is not online. Lo202
Joined: 31 Jan 2013
Total Posts: 579
11 Jul 2014 02:05 AM
Bump
Report Abuse
2eggnog is not online. 2eggnog
Joined: 08 Nov 2008
Total Posts: 1351
11 Jul 2014 03:02 AM
getservice = game:GetService("MarketplaceService")

function onChatted(msg, recipent, speaker)
if (string.sub(msg, 1,5) == "info/") then
local info = string.sub(msg, 6)
local asset = getservice:GetProductInfo(info)
message = Instance.new("Message", game.Workspace)
message.Text = asset.Name.." : "..asset.Description
end
end
function onEntered(newPlayer)
newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end)
end
Report Abuse
smiley599 is not online. smiley599
Joined: 23 Jan 2010
Total Posts: 21869
11 Jul 2014 03:04 AM
local info = string.sub(msg, 5)

5 should be 6 and if not, try 7
Report Abuse
Geodesic is not online. Geodesic
Joined: 02 Jun 2013
Total Posts: 998
11 Jul 2014 03:15 AM
you have no connection line for the onentered function

function onChatted(msg, recipent, speaker)
if (string.sub(msg, 1,5) == "info/") then
local info = string.sub(msg, 5)
local asset = getservice:GetProductInfo(info)
message = Instance.new("Message", game.Workspace)
message.Text = asset.Name.." : "..asset.Description
end
end
function onEntered(newPlayer)
newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end)
end
game.Players.PlayerAdded:connect(onEntered)
Report Abuse
2eggnog is not online. 2eggnog
Joined: 08 Nov 2008
Total Posts: 1351
11 Jul 2014 03:16 AM
I tested it; 6 works.
Report Abuse
Lo202 is not online. Lo202
Joined: 31 Jan 2013
Total Posts: 579
11 Jul 2014 04:02 AM
doesn't work for me.
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