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 » Scripters
Home Search
 

Re: Easier way to make chat commands?

Previous Thread :: Next Thread 
DurstAuric is not online. DurstAuric
Joined: 12 May 2009
Total Posts: 8066
04 Jun 2016 02:32 PM
So uh, I've been using sub to make them, but I know there's more efficient methods of doing so. And uh, I'm starting to confuse myself here because of this sub thing. I heard string patterns are good, but I really don't know how to use them..

if Message:sub(1, 5 + #Settings.Bet):lower() == ("Music"..Settings.Bet):lower() then
if Message:sub(6 + #Settings.Bet, #Message):lower() == ("Stop"):lower() then
GameMusic:Stop()
elseif Message:sub(6 + #Settings.Bet, 6 + #Settings.Bet + 6 + #Settings.Bet):lower() == ("Volume"..Settings.Bet):lower() then
GameMusic.Volume = tonumber(Message:sub(6 + #Settings.Bet + 6 + #Settings.Bet, #Message))
end
end


-=[ RAP: 297,601 || DurstAuric; the narb of ROBLOX ]=-
Report Abuse
DurstAuric is not online. DurstAuric
Joined: 12 May 2009
Total Posts: 8066
04 Jun 2016 02:36 PM
Bump..


-=[ RAP: 297,611 || DurstAuric; the narb of ROBLOX ]=-
Report Abuse
DurstAuric is not online. DurstAuric
Joined: 12 May 2009
Total Posts: 8066
04 Jun 2016 02:46 PM
Another bump.


-=[ RAP: 297,587 || DurstAuric; the narb of ROBLOX ]=-
Report Abuse
DurstAuric is not online. DurstAuric
Joined: 12 May 2009
Total Posts: 8066
04 Jun 2016 03:11 PM
Last bump.


-=[ RAP: 297,614 || DurstAuric; the narb of ROBLOX ]=-
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
04 Jun 2016 03:12 PM
organize it into functions and then just call the functions based on the command


Report Abuse
DurstAuric is not online. DurstAuric
Joined: 12 May 2009
Total Posts: 8066
04 Jun 2016 03:15 PM
I have functions, but I really despise using sub. I need a more efficient way than sub.


-=[ RAP: 297,614 || DurstAuric; the narb of ROBLOX ]=-
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
04 Jun 2016 03:16 PM
find or gmatch/match


Report Abuse
DurstAuric is not online. DurstAuric
Joined: 12 May 2009
Total Posts: 8066
04 Jun 2016 03:18 PM
Okay.. Any examples?


-=[ RAP: 297,615 || DurstAuric; the narb of ROBLOX ]=-
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
04 Jun 2016 03:23 PM
local prefix = ":"

msg = ":hi"

if msg:find(prefix) then

for example


Report Abuse
HalfPinky456 is not online. HalfPinky456
Joined: 10 Apr 2011
Total Posts: 6236
04 Jun 2016 03:24 PM
http://wiki.roblox.com/index.php?title=String_pattern


nothin' like a good argument
Report Abuse
DurstAuric is not online. DurstAuric
Joined: 12 May 2009
Total Posts: 8066
04 Jun 2016 07:08 PM
I need to learn how to use string patterns because that wiki article is confusing.. This doesn't work..

for Match in Message:gmatch("%Music"):lower() do
print(Match)
end


-=[ RAP: 298,129 || DurstAuric; the narb of ROBLOX ]=-
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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