Im getting no output for Lua.. and the function also wont run. This is V2 so... I know the way I have the admin set up it SHOULD run it, but yet fails.
BTW, I learned string.sub yestraday.. Please do not judge if this is bad coding. :L
AddCommand(0,"Print","Print","P",":Print I like tacos --> [M.A.C.] I like tacos",function(Speaker,Msg)
_G.Print(Speaker..' : '..Msg)
end) -- ^^^^ This will insert into _G.Commands.
CheckChat=function(plr,msg)
table.foreach(_G.Commands,function(i,v)
local Cmd=v.Cmd:lower()
local Cmd2=v.Cmd2:lower()
local SubCount=1
if msg:sub(1,3):find('/e ') then
SubCount=3
else
SubCount=1
end
_G.Print(msg)
if msg:sub(SubCount,#( (Settings.FrontPrefix..(Cmd) or Settings.FrontPrefix..(Cmd)..Settings.MiddlePrefix)
or (Settings.FrontPrefix..(Cmd2) or Settings.FrontPrefix..(Cmd2)..Settings.MiddlePrefix) ))
==
((Settings.FrontPrefix..(Cmd) or Settings.FrontPrefix..(Cmd)..Settings.MiddlePrefix)
or (Settings.FrontPrefix..(Cmd2) or Settings.FrontPrefix..(Cmd2)..Settings.MiddlePrefix) ) then
if (_G.GetRank(plr) <= v.Rank) then
msg=msg:sub(#((Settings.FrontPrefix..(Cmd) or Settings.FrontPrefix..(Cmd)..Settings.MiddlePrefix)
or (Settings.FrontPrefix..(Cmd2) or Settings.FrontPrefix..(Cmd2)..Settings.MiddlePrefix))+1)
local r,e=ypcall(function()
v.Func(plr,msg)
end)
if not r then _G.Error(e) end
else
--You cant acess this command!
end
else
--Sorry command was not found!
end
end)
end

1 comment
Sorry if you gonna help you kinda HAVE to read all the string.sub... :L