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: Why wont this work?

Previous Thread :: Next Thread 
Fedorakid is not online. 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 is not online. Xnite515
Joined: 18 Feb 2011
Total Posts: 22763
13 Feb 2013 01:29 PM
msg.sub(4)

Your grabbing the "/"
Report Abuse
Fedorakid is not online. 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 is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
13 Feb 2013 02:03 PM
Still doesent work :(
Report Abuse
Fedorakid is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
13 Feb 2013 02:17 PM
This is the full script -.-
Report Abuse
dmjoe is not online. 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 is not online. 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 is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
13 Feb 2013 03:12 PM
Bump.
Report Abuse
RenderSettings is not online. RenderSettings
Joined: 16 Aug 2010
Total Posts: 2560
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 is not online. 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 is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
13 Feb 2013 03:32 PM
bump...
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
13 Feb 2013 03:47 PM
-.- bump...
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
13 Feb 2013 03:57 PM
Good help....bump.
Report Abuse
crouton04 is not online. 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 is not online. 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 is not online. 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 is not online. Trioxide
Joined: 29 Mar 2011
Total Posts: 32902
14 Feb 2013 03:36 PM
[ Content Deleted ]
Report Abuse
Fedorakid is not online. 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 is not online. Trioxide
Joined: 29 Mar 2011
Total Posts: 32902
14 Feb 2013 03:50 PM
[ Content Deleted ]
Report Abuse
Fedorakid is not online. 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 is not online. Trioxide
Joined: 29 Mar 2011
Total Posts: 32902
14 Feb 2013 03:53 PM
[ Content Deleted ]
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