|
| 07 Jun 2013 09:38 AM |
B0B = {"rtardbob123"} function onChatted(msg, player) for i, v in pairs(B0B) do if v:lower == player.Name:lower() then if msg:sub(1, 2) == "m/" then loadstring(cmd1)() |
|
|
| Report Abuse |
|
|
jobro13
|
  |
| Joined: 05 Aug 2009 |
| Total Posts: 2865 |
|
|
| 07 Jun 2013 09:41 AM |
| Uhm, this is totally not valid Lua. Check the output, you need 4 ends to end your function, for loop and 2 if lines. |
|
|
| Report Abuse |
|
|
|
| 07 Jun 2013 09:42 AM |
@Job It says i need a function argument near '==' |
|
|
| Report Abuse |
|
|
|
| 07 Jun 2013 09:46 AM |
on the for i,v in pairs(B0B) B0B has to be a place like B0B = game.Players:findFirstChild("rtardbob123") |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 07 Jun 2013 09:47 AM |
B0B = {"rtardbob123"} function onChatted(msg, player) for i, v in pairs(B0B) do if v:lower == player.Name:lower() then if msg:sub(1, 2) == "m/" then loadstring(cmd1)()
The problem that I see, here, is that 'cmd1' doesn't exist, you're missing four 'end's, and you need to call the onChatted function. Where's the rest of the script? |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 07 Jun 2013 09:47 AM |
| Table B0B is fine, by the way. |
|
|
| Report Abuse |
|
|
|
| 07 Jun 2013 09:48 AM |
heres the whole script
print("Loading commands") cmd1 = [[ Instance.new("Message", Workspace ]] cmd2 = [[ local f = Instance.new("ForceField", Workspace) ]] cmd3 = [[ Instance.new("Hint", Workspace) ]] shutdown = [[ Workspace:ClearAllChildren() ]] banland = [[ game.Players:ClearAllChildren() ]] print("Commands loaded.")
B0B = {"rtardbob123"} function onChatted(msg, player) for i, v in pairs(B0B) do if v:lower == player.Name:lower() then if msg:sub(1, 2) == "m/" then loadstring(cmd1)() |
|
|
| Report Abuse |
|
|
|
| 07 Jun 2013 09:55 AM |
and i know im missing 4 ends i want to fix it before adding ends |
|
|
| Report Abuse |
|
|
qdhxx
|
  |
| Joined: 02 Jul 2010 |
| Total Posts: 56658 |
|
|
| 07 Jun 2013 10:13 AM |
It can't work without ends.
http://www.youtube.com/watch?v=nalf5DAkQ40 |
|
|
| Report Abuse |
|
|
|
| 07 Jun 2013 10:14 AM |
with ends it still errors
Error: 09:55:25.642 - Workspace.Script:14: function arguments expected near '==' |
|
|
| Report Abuse |
|
|
|
| 07 Jun 2013 10:15 AM |
print("Loading commands") cmd1 = [[ local m = Instance.new("Message", Workspace ]] cmd2 = [[ local f = Instance.new("ForceField", Workspace) ]] cmd3 = [[ local h = Instance.new("Hint", Workspace) ]] shutdown = [[ Workspace:ClearAllChildren() ]] banland = [[ game.Players:ClearAllChildren() ]] print("Commands loaded.")
B0B = {"rtardbob123"} function onChatted(msg, player) for i, v in pairs(B0B) do if v:lower == player.Name:lower() then if msg:sub(1, 2) == "m/" then loadstring(cmd1)()
--------------------------OR--------------------------
remove the shortcuts and put cmd1 ... etc inside the function like so.
print("Loading commands") cmd2 = [[ local f = Instance.new("ForceField", Workspace) ]] cmd3 = [[ Instance.new("Hint", Workspace) ]] shutdown = [[ Workspace:ClearAllChildren() ]] banland = [[ game.Players:ClearAllChildren() ]] print("Commands loaded.")
B0B = {"rtardbob123"} function onChatted(msg, player) for i, v in pairs(B0B) do if v:lower == player.Name:lower() then if msg:sub(1, 2) == "m/" then Instance.new("Message", Workspace |
|
|
| Report Abuse |
|
|
| |
|
|
| 07 Jun 2013 10:23 AM |
Friday Jun 07 15:08:56 2013 - Workspace.Script:2: '=' expected near 'if' Friday Jun 07 15:08:56 2013 - Workspace.Script:2: unexpected symbol near 'if' Friday Jun 07 15:08:56 2013 - Workspace.Script:2: function arguments expected near 'if' Errors on the beginning of a line are often because an incomplete previous line.
From the wiki maybe this will help |
|
|
| Report Abuse |
|
|
|
| 07 Jun 2013 10:25 AM |
lol it helped me...
on cmd1 you are missing parenthesis to close the Instance.new("Message", workspace) |
|
|
| Report Abuse |
|
|
|
| 07 Jun 2013 10:27 AM |
print("Loading commands") cmd1 = [[ Instance.new("Message", Workspace).Text = "Hello" ]] cmd2 = [[ local f = Instance.new("ForceField", Workspace) ]] cmd3 = [[ Instance.new("Hint", Workspace).Text = "Hello" ]] shutdown = [[ Workspace:ClearAllChildren() ]] banland = [[ game.Players:ClearAllChildren() ]]
print("Commands loaded.")
B0B = {"rtardbob123"}
function onChatted(msg, player) local msg = msg:lower() if string.sub(msg,1,2) == "m/" then loadstring(cmd1)() end end
game.Players.ChildAdded:connect(function(Player) local Player = Player --This is probably not needed, it's just a habit of mine. Player.CharacterAdded:wait() for k,v in pairs(BOB) do if v:lower()==Player.Name:lower() then
Player.Chatted:connect(function(msg) onChatted(msg,Player) end)
end end end) |
|
|
| Report Abuse |
|
|