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 Commands

Previous Thread :: Next Thread 
Yionee is not online. Yionee
Joined: 03 Oct 2010
Total Posts: 322
01 Sep 2011 11:08 PM
I left Roblox for about two weeks because of personal matters. Now, that I am back, I want to continue making my admin commands but I seem to have forgotten how. I don't know how I could let myself forget how to make admin scripts. Here is a shortened piece of code I made that has one command. When going into Roblox Studio and testing it, I get no errors so I tried to shorten it so that you guys would not have to take a long time searching. I have been working on this about an hour and I don't know what is wrong.




admin_list = {"Yionee"}

function yio(pl)
for i = 1, #admin_list do
if pl.Name == admin_list[i] then
pl.Chatted:connect(function() Spawn(function() chat(msg) end) end)
end end end
game.Players.PlayerAdded:connect(yio)

chat = function(msg)

if string.sub(msg,1,2) == "m/" then
local mess = Instance.new("Message",Workspace)
mess.Text = string.sub(msg,5)
wait(msg:sub(3))
mess:remove()
end

end
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
01 Sep 2011 11:10 PM
(msg,3)

­<'+1 Post. Ujelly?'>
Report Abuse
Yionee is not online. Yionee
Joined: 03 Oct 2010
Total Posts: 322
01 Sep 2011 11:15 PM
Are you talking about the wait() ?
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
01 Sep 2011 11:16 PM
there are multiple problems with that code

­<'+1 Post. Ujelly?'>
Report Abuse
Yionee is not online. Yionee
Joined: 03 Oct 2010
Total Posts: 322
01 Sep 2011 11:17 PM
I noticed.
Report Abuse
Yionee is not online. Yionee
Joined: 03 Oct 2010
Total Posts: 322
01 Sep 2011 11:18 PM
I haven't used string.sub in a LONG time and IDK if I even used that right.
Report Abuse
Yionee is not online. Yionee
Joined: 03 Oct 2010
Total Posts: 322
01 Sep 2011 11:21 PM
FAIL FAIL FAIL FAIL!!

I didn't even have the aruguement for the Chatted event!
Report Abuse
SpeedySeat is online. SpeedySeat
Joined: 06 Jul 2011
Total Posts: 3048
01 Sep 2011 11:56 PM
Actually the sub positions are fine.

if he said something like m/06Hello world! this is a message that takes 6 seconds to read!

in chat then that message appears for "06" seconds.

props, thats really original.
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