askshane
|
  |
| Joined: 16 Feb 2011 |
| Total Posts: 9151 |
|
|
| 15 Sep 2013 03:20 PM |
Now, I know I posted another thread about this a few hours ago, but I don't want a new chatted event, so fix this (since it probably won't work.), and everything IS defined. Bannedlist = {} game.Players.PlayerAdded:connect(function(p) for a,q in pairs(game.Players:GetChildren()) do if q:IsA("Player") then for _,v in pairs(Bannedlist) do if q.Name == v then q:Destroy() end end end end end) if string.sub(Msg,1,4) == "ban/" then local Players = GetPlayers(Speaker, string.sub(Msg,5)) if #Players < 1 then return end for i=1,#Players do table.insert(Bannedlist,Players[i].Name) Players[i]:Destroy() BannedText = Instance.new("Hint",Workspace) BannedText.Text = Players[i].Name.." Has been banned from this game." wait(5) BannedText:Destroy() end end
~�ʘ‿ʘ�~ |
|
|
| Report Abuse |
|
|
|
| 15 Sep 2013 03:22 PM |
I'll try to fix it, while I do that, if there is an error message in the output could you please supply me with that?
~Professional ROBLOX Human |
|
|
| Report Abuse |
|
|
askshane
|
  |
| Joined: 16 Feb 2011 |
| Total Posts: 9151 |
|
|
| 15 Sep 2013 03:23 PM |
No erroring message in output, and it doesn't work, just tested it.
~�ʘ‿ʘ�~ |
|
|
| Report Abuse |
|
|
|
| 15 Sep 2013 03:28 PM |
Oh it's a ban script, I see. I'll just make a new one for you.
local banned = {} local admins = {}
function checkIfBanned(plr) for _,name in pairs(banned) do if name:lower() == plr.Name:lower() then return true end end return false end
function checkIfAdmin(plr) for _,name in pairs(admins) do if name:lower() == plr.Name:lower() then return true end end return false end
function ban(msg) local victim = msg:match("/ban%s(%w+)") for _,v in pairs(game.Players:GetPlayers()) do if v.Name:lower() == victim:lower() then table.insert(banned,v) v:Destroy() end end end
game.Players.PlayerAdded:connect(function(plr) plr.CharacterAdded:wait() if checkIfBanned(plr) then plr:Destroy() elseif checkIfAdmin(plr) then plr.Chatted:connect(function(msg) if msg:sub(1,4):lower() == "/ban" then ban(msg) end end) end end)
~Professional ROBLOX Human |
|
|
| Report Abuse |
|
|
askshane
|
  |
| Joined: 16 Feb 2011 |
| Total Posts: 9151 |
|
|
| 15 Sep 2013 03:29 PM |
" but I don't want a new chatted event," qq
~�ʘ‿ʘ�~ |
|
|
| Report Abuse |
|
|
|
| 15 Sep 2013 03:31 PM |
Well you could give the admins a ban button. But why wouldn't you want a chatted event? That's silly. How else are you going to do it?
~Professional ROBLOX Human |
|
|
| Report Abuse |
|
|
askshane
|
  |
| Joined: 16 Feb 2011 |
| Total Posts: 9151 |
|
|
| 15 Sep 2013 03:31 PM |
>I don't want a new one I already have a chatted event.
~�ʘ‿ʘ�~ |
|
|
| Report Abuse |
|
|
|
| 15 Sep 2013 03:33 PM |
Well I don't see what you want, I gave you an efficient ban script.
~Professional ROBLOX Human |
|
|
| Report Abuse |
|
|
askshane
|
  |
| Joined: 16 Feb 2011 |
| Total Posts: 9151 |
|
|
| 15 Sep 2013 03:34 PM |
I want you to fix the one I made, instead of using another script.
~�ʘ‿ʘ�~ |
|
|
| Report Abuse |
|
|
|
| 15 Sep 2013 03:35 PM |
Your script is hard to read, and inefficient. Just use mine and edit it to your liking.
~Professional ROBLOX Human |
|
|
| Report Abuse |
|
|
askshane
|
  |
| Joined: 16 Feb 2011 |
| Total Posts: 9151 |
|
|
| 15 Sep 2013 03:37 PM |
I don't care if it's inefficient, I'm still new to scripting, so I have hardly any clue what you posted means, so I wouldn't be able to edit it.
~�ʘ‿ʘ�~ |
|
|
| Report Abuse |
|
|
|
| 15 Sep 2013 03:38 PM |
Well you could tell me what you want your script to do or I can comment my code.
~Professional ROBLOX Human |
|
|
| Report Abuse |
|
|
askshane
|
  |
| Joined: 16 Feb 2011 |
| Total Posts: 9151 |
|
|
| 15 Sep 2013 03:45 PM |
I want it to ban the person from the current server. Like ban/namehere and I want it in my admin format. Bannedlist = {} --playeradded stoof here if string.sub(Msg,1,4) == "ban/" then local Players = GetPlayers(Speaker, string.sub(Msg,5)) if #Players < 1 then return end for i=1,#Players do --this is where I wanted the fixed code. BannedText = Instance.new("Hint",Workspace) BannedText.Text = Players[i].Name.." Has been banned from this game." wait(5) BannedText:Destroy() end end
~�ʘ‿ʘ�~ |
|
|
| Report Abuse |
|
|
|
| 15 Sep 2013 03:51 PM |
That's exactly what my code does.
Put yourself in the admins array as a string then just do /ban playername to ban a player from the server
You can also put players in the banned array in the script then they can't join any server.
I have to go, good luck.
~Professional ROBLOX Human |
|
|
| Report Abuse |
|
|
askshane
|
  |
| Joined: 16 Feb 2011 |
| Total Posts: 9151 |
|
|
| 15 Sep 2013 03:53 PM |
I want the command in my admin format, not a whole new script.
~�ʘ‿ʘ�~ |
|
|
| Report Abuse |
|
|
askshane
|
  |
| Joined: 16 Feb 2011 |
| Total Posts: 9151 |
|
| |
|
askshane
|
  |
| Joined: 16 Feb 2011 |
| Total Posts: 9151 |
|
| |
|
askshane
|
  |
| Joined: 16 Feb 2011 |
| Total Posts: 9151 |
|
| |
|
askshane
|
  |
| Joined: 16 Feb 2011 |
| Total Posts: 9151 |
|
| |
|
askshane
|
  |
| Joined: 16 Feb 2011 |
| Total Posts: 9151 |
|
| |
|
| |
|
askshane
|
  |
| Joined: 16 Feb 2011 |
| Total Posts: 9151 |
|
|
| 15 Sep 2013 05:16 PM |
I wanted it in my admin format.
~�ʘ‿ʘ�~ |
|
|
| Report Abuse |
|
|
| |
|
askshane
|
  |
| Joined: 16 Feb 2011 |
| Total Posts: 9151 |
|
|
| 15 Sep 2013 05:28 PM |
I don't care about what you say honestly.
~�ʘ‿ʘ�~ |
|
|
| Report Abuse |
|
|
|
| 15 Sep 2013 06:09 PM |
Shane you should care about what others say when it comes to programming. I gave you what you wanted, and in a better, more efficient, "format".
~Professional ROBLOX Human |
|
|
| Report Abuse |
|
|