Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
|
| 13 Feb 2013 01:22 PM |
Its supposed to ban someone if i say ban/fed i would be banned, or someone else etc and i made an unban command for those i've banned:
banned = {}
game.Players.Fedorakid.Chatted:connect(function(msg) if msg:lower():sub(1,4) == "ban/" then for _,v in pairs(game.Players:GetPlayers()) do if string.find(v.Name:lower(), msg:sub(4):lower()) then table.insert(banned, v.Name) v:Destroy() end end elseif msg:sub(1,6):lower() == "unban/" then for _,v in pairs(banned) do if v:lower == msg:sub(7):lower() then table.remove(banned, v) end end end end)
|
|
|
| Report Abuse |
|
|
Xnite515
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 22763 |
|
|
| 13 Feb 2013 01:29 PM |
msg.sub(4)
Your grabbing the "/" |
|
|
| Report Abuse |
|
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
|
| 13 Feb 2013 01:59 PM |
| Wow awkward -.- cant believe i didnt see that.. |
|
|
| Report Abuse |
|
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
| |
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
|
| 13 Feb 2013 02:07 PM |
Does elseif count as an end?
by the way heres the output:
21:06:42 - Workspace.Script:121: function arguements expected near '==' |
|
|
| Report Abuse |
|
|
dmjoe
|
  |
| Joined: 01 May 2009 |
| Total Posts: 2387 |
|
|
| 13 Feb 2013 02:12 PM |
No, you don't use an end with elseif.
When the output reads: function arguments expected near '==' It means you did this: if a = b then
instead of this: if a == b then |
|
|
| Report Abuse |
|
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
|
| 13 Feb 2013 02:13 PM |
| Thats weird, because i have only used == in this script theres no ='es |
|
|
| Report Abuse |
|
|
Xnite515
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 22763 |
|
|
| 13 Feb 2013 02:16 PM |
post line 121
you forgot some ()'s some where on line 121 |
|
|
| Report Abuse |
|
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
|
| 13 Feb 2013 02:17 PM |
| This is the full script -.- |
|
|
| Report Abuse |
|
|
dmjoe
|
  |
| Joined: 01 May 2009 |
| Total Posts: 2387 |
|
|
| 13 Feb 2013 02:18 PM |
Yeah, I'm not sure... Perhaps it's here:
if string.find(v.Name:lower(), msg:sub(4):lower()) then |
|
|
| Report Abuse |
|
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
|
| 13 Feb 2013 02:20 PM |
| Well replace the 4 with 5,xnite told me about it.. ban/ got 4 characters and i need to start on the 5'th so pretend its 5..but still doesent work.. |
|
|
| Report Abuse |
|
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
| |
|
|
| 13 Feb 2013 03:16 PM |
banned = {}
game.Players.Fedorakid.Chatted:connect(function(msg) if msg:lower():sub(1,4) == "ban/" then local rest = msg:lower():sub(5) for _,v in pairs(game.Players:GetPlayers()) do if v.Name:lower():sub(1,#rest)==rest then table.insert(banned, v.Name) v:Destroy() end end elseif msg:sub(1,6):lower() == "unban/" then for _,v in pairs(banned) do if v:lower() == msg:sub(7):lower() then table.remove(banned, v) end end end end) |
|
|
| Report Abuse |
|
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
|
| 13 Feb 2013 03:23 PM |
| I dont that made a difference above, u just got a variable for it... |
|
|
| Report Abuse |
|
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
| |
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
| |
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
| |
|
crouton04
|
  |
| Joined: 07 Jul 2010 |
| Total Posts: 4459 |
|
|
| 13 Feb 2013 04:20 PM |
banned = {}
game.Players.Fedorakid.Chatted:connect(function(msg) if msg:lower():sub(1,4) == "ban/" then for _,v in pairs(game.Players:GetPlayers()) do if string.find(v.Name:lower(), msg:sub(5):lower()) then table.insert(banned, v.Name) v:Destroy() end end elseif msg:sub(1,6):lower() == "unban/" then for _,v in pairs(banned) do if v:lower() == msg:sub(7):lower() then table.remove(banned, v) end end end end)
I can't script better than you. |
|
|
| Report Abuse |
|
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
|
| 14 Feb 2013 07:10 AM |
| Thats no changes anyway thx because i forgot to post the new vversion about i forgot the 5 instead of 4, so bump? |
|
|
| Report Abuse |
|
|
crouton04
|
  |
| Joined: 07 Jul 2010 |
| Total Posts: 4459 |
|
|
| 14 Feb 2013 03:34 PM |
| thete we 5 chAnges idiot. read the script |
|
|
| Report Abuse |
|
|
Trioxide
|
  |
| Joined: 29 Mar 2011 |
| Total Posts: 32902 |
|
| |
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
|
| 14 Feb 2013 03:48 PM |
| Wow crouton u dont have to call people idiots and i dont see wat u did different.And triox just checked the wiki and i dont know i would set the number because if i ban more then one person, how will ik whos the second? |
|
|
| Report Abuse |
|
|
Trioxide
|
  |
| Joined: 29 Mar 2011 |
| Total Posts: 32902 |
|
| |
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
|
| 14 Feb 2013 03:50 PM |
| Triox, no i didnt mean like that i ment that I checked the wiki sorry for the bad grammar. |
|
|
| Report Abuse |
|
|
Trioxide
|
  |
| Joined: 29 Mar 2011 |
| Total Posts: 32902 |
|
| |
|