Yes, I am developing another Admin Commands system, but only with a better, and cleaner type of code [Different from my other ones, where they have allot of code], however, something is not executing the command, for example, when I attempt to say in the Studio, :kill player, it will not execute the command for some reason, but, when I type in reset, it will fire that command. Sadly, I am very confused on why it is doing this, and why it is not executing the command, I am thinking the error is at line 46, but I am not too sure, as that is supposed to prevent someone who is not an Admin from using the :kill player command. Here is the code I am currently using;
local Admins = {
['TheeDeathCaster'] = true;
['Player'] = true;
['yournamehere'] = true;
[44391621] = true;
}
local Banland = {
['someoneyouhate'] = true;
[40265333] = true;
}
local Prefixes = {":",";","/","_"}
function ChkPrefix(str)
local Prefix = "";
for i = 1, #Prefixes do
for x = 1, #str do
if str:sub(i,i) == Prefixes[i] then
Prefix = str:sub(i,i)
break
end
end
end
if Prefix ~= "" then
return Prefix
else
return false
end
end
function GetPlr(str)
local plrz = {};
for i,v in pairs(game.Players:GetPlayers()) do
if str ~= "" and (v.Name:lower():find(str) == (1)) then
table.insert(plrz,v)
end
end
return plrz
end
function Chats(plr,msg)
if (msg:lower():find("reset") == (1)) then return false, plr:LoadCharacter() end
if not Admins[plr.Name] and not Admins[plr.userId] and not ChkPrefix(msg) then return false end --Line 46, where I think the error is, although, this is where it is supposed to prevent a 'Non-Admin' to use the ':kill player' command
local Len = ChkPrefix(msg); msg = msg:sub(Len:len()+1) --Gets the length of the 'msg' of where the 'Prefix' is, then allows you to execute the command below;
if msg:lower():find("kill ") then
local chk1 = msg:lower():find("kill ");
local plrz = GetPlr(chk1+1);
for i,v in pairs(plrz) do
if v.Character then
v.Character:BreakJoints()
end
end
end
end
function AdminControl(plr)
if Admins[plr.Name] or Admins[plr.userId] then print(plr.Name," is an Admin!") end
if Banland[plr.Name] or Banland[plr.userId] then plr:Destroy() print(plr.Name," is currently banned.") end
plr.Chatted:connect(function(msg) Chats(plr,msg) end)
end
game.Players.PlayerAdded:connect(AdminControl)
for i,v in pairs(game.Players:GetPlayers()) do AdminControl(v) end
If you need me to tab my code correctly/better, I'll do it as soon as possible.

5 comments
You really should tab your code correctly at the time you're writing it. It makes everything easier to read and debug. My dad was deducted points for not tabbing his code correctly when he was in collage. Just get into the habit.
If I may ask, because I think I got mixed up with another definition of 'tabbing' my code, because I keep thinking it's to seperate the different codes, or, to spread it out, may I ask what the correct definition for 'tabbing code' is?
It's basically indenting using the 'tab' key. Pretty much every time you start a new scope, everything inside that scope should be indented one tab space to the right. http://wiki.roblox.com/index.php?title=Writing_Clean_Code#Indenting
Ah, that explains it, thanks for the explanation! :D However, tabbing like that gives me a harder time understanding a certain chunk of code for some reason, and I not am too sure why that is.
This admin sucks. >.<