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: Strings help?

Previous Thread :: Next Thread 
DuckD0nald is not online. DuckD0nald
Joined: 21 Aug 2008
Total Posts: 9870
26 Jul 2014 11:31 AM
I want to make a simple script that changes the text of a GUI whenever I say the word "topic " at the beginning of a message and then anything after the word "topic ". The problem is, I can't figure out how to make an appropriate if statement to do so.

Code:
local topic = "Test Test Test"
local label = script.Parent

while true do
wait()
label.Text = topic
end

game.Players.PlayerAdded:connect(function(pl)
pl.Chatted:connect(function(msg)
if (pl.userId == 896716) and (msg == "topic ") then -- help???
topic = msg
end
end)
end
)
Report Abuse
WishNite is not online. WishNite
Joined: 11 Feb 2009
Total Posts: 15828
26 Jul 2014 11:33 AM
msg:lower():sub(1,6) == "topic "
Report Abuse
DuckD0nald is not online. DuckD0nald
Joined: 21 Aug 2008
Total Posts: 9870
26 Jul 2014 11:36 AM
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