fizzman
|
  |
| Joined: 08 Apr 2008 |
| Total Posts: 141 |
|
|
| 19 Sep 2011 11:09 AM |
Hello. I am making an admin script, one with voice commands. Is there anyone who knows how to insert a script into the workspace when I say a command? Thanks for any help. Fizzman |
|
|
| Report Abuse |
|
Miro034
|
  |
| Joined: 07 Oct 2009 |
| Total Posts: 6568 |
|
| |
|
| 19 Sep 2011 11:29 AM |
@Miro
You ain't really helping. If you're gonna help, then please do it without sarcasm/do it good. By 'good' I mean explaining.
Insert>Object>Script
Open the Script's Source. It should be in workspace. What you now should do is create a .Chatted event. I'll make a little pre-view for you:
commands = {"kill/","kick/"} admins = {"NAME","NAME"} for i,v in pairs(commands) do chatted = function(msg,recipient,speaker) if string.sub(msg,1,5) == commands[1] then for i,v in pairs(game.Players:GetChildren()) do if v.Name == string.find(msg,5) then v.Character:BreakJoints() end end elseif string.sub(msg,1,5) == commands[2] then for i,v in pairs(game.Players:GetChildren()) do if v.Name == string.find(msg,5) then v:remove() end end end end end
game.Players.PlayerAdded:connect(function(plr) for i,v in pairs(admins) do if plr.Name == v then plr.Chatted:connect(function(msg) chatted(msg,recipient,plr) end) end end end) |
|
|
| Report Abuse |
|
Miro034
|
  |
| Joined: 07 Oct 2009 |
| Total Posts: 6568 |
|
|
| 19 Sep 2011 11:30 AM |
| I'm sorry, I didn't really read everthing. Sorry fiz...and utter xD |
|
|
| Report Abuse |
|
fizzman
|
  |
| Joined: 08 Apr 2008 |
| Total Posts: 141 |
|
|
| 19 Sep 2011 11:31 AM |
| Ty Utter, dont worry Miro. |
|
|
| Report Abuse |
|