I would think if you can solve my problem so it depends on this error:
And code is
So,x5

edited 1×, last 21.02.18 07:03:29 pm
if Rank[2] < Rank[1] then
Rank = {} addhook("join","scriptfavor.admin.join") function scriptfavor.admin.join(id) if isAdmin(id) then Rank[id] = 2 end if isMod(id) then Rank[id] = 1 end end
commands["!shake"] = { enabled = true, permission = 1, arguments = 1, syntax = "<id>", func = function(id,arguments) local arg = tonumber(arguments[1]) if isAdmin(id) and isMod(id) then if not arg then return msg2(id,""..string.char(169).."000250155[Server]: "..string.char(169).."255255255Invalid numeric value.") end if not player(arg,"exists") then return msg2(id,""..string.char(169).."000250155[Server]: "..string.char(169).."255255255Player with the specified "..arg.." does not exist.") end if player(arg,"bot") then return msg2(id,""..string.char(169).."000250155[Server]: "..string.char(169).."255255255You can't shake a bot") end if arg == id then return msg2(id,""..string.char(169).."000250155[Server]: "..string.char(169).."255255255You can not shake yourself.") end parse("shake "..arg.." 900") msg(""..string.char(169).."000250155[Server]: "..string.char(169).."255255255"..player(id,"name").." Used shake on "..player(arg,"name").."") else if Rank[id] < Rank[arg] then return msg2(id,""..string.char(169).."000250155[Server]: "..string.char(169).."255255255You can't kick higher staff")end end end };
Rank = {} addhook("join","scriptfavor.admin.join") function scriptfavor.admin.join(id) if isAdmin(id) then Rank[id] = 2 end if isMod(id) then Rank[id] = 1 else Rank[id] = 0 end end
Rank = {} addhook("join","scriptfavor.admin.join") function scriptfavor.admin.join(id) if isAdmin(id) then Rank[id] = 2 elseif isMod(id) then Rank[id] = 1 else Rank[id] = 0 end end
LUA ERROR: sys/lua/command.lua:89: attempt to compare number with nil
if Rank[id] < Rank[arg] then RETURN msg2(id,""..string.char(169)..
Rank = {} --untested FIXED!!! addhook("join","scriptfavor.admin.join") function scriptfavor.admin.join(id) if isAdmin(id) and isMod(id) then Rank[id] = 3 return end if isAdmin(id) then Rank[id] = 2 return end if isMod(id) then Rank[id] = 1 return end Rank[id] = 0 end
commands["!shake"] = { enabled = true, permission = 1, arguments = 1, syntax = "<id>", func = function(id,arguments) local arg = tonumber(arguments[1]) if Rank[id] < Rank[arg] then ---------> ez if not arg then return msg2(id,""..string.char(169).."000250155[Server]: "..string.char(169).."255255255Invalid numeric value.") end if not player(arg,"exists") then return msg2(id,""..string.char(169).."000250155[Server]: "..string.char(169).."255255255Player with the specified "..arg.." does not exist.") end if player(arg,"bot") then return msg2(id,""..string.char(169).."000250155[Server]: "..string.char(169).."255255255You can't shake a bot") end if arg == id then return msg2(id,""..string.char(169).."000250155[Server]: "..string.char(169).."255255255You can not shake yourself.") end parse("shake "..arg.." 900") msg(""..string.char(169).."000250155[Server]: "..string.char(169).."255255255"..player(id,"name").." Used shake on "..player(arg,"name").."") end end };
if Rank[id] < Rank[arg] then return msg2(id,""..string.char(169).."000250155[Server]: "..string.char(169).."255255255You can't kick higher staff")end
function totable(t,match) local cmd = {} if not match then match = "[^%s]+" end for word in string.gmatch(t, match) do table.insert(cmd, word) end return cmd end
commands["!shake"] = { enabled = true, permission = 1, arguments = 1, syntax = "<id>", func = function(id,arguments) if isAdmin(id) and isMod(id) then local argt=totable(arguments) local arg = tonumber(argt[1]) if (arg==nil or not arg) then msg2(id,""..string.char(169).."000250155[Server]: "..string.char(169).."255255255Invalid numeric value.") return false end if arg~=nil and not player(arg,"exists") then msg2(id,""..string.char(169).."000250155[Server]: "..string.char(169).."255255255Player with the specified "..arg.." does not exist.") return false end if arg~=nil and player(arg,"bot") then msg2(id,""..string.char(169).."000250155[Server]: "..string.char(169).."255255255You can't shake a bot") return false end if arg~=nil and arg == id then msg2(id,""..string.char(169).."000250155[Server]: "..string.char(169).."255255255You can not shake yourself.") return false end if arg~=nil and Rank[id] < Rank[arg] then msg2(id,""..string.char(169).."000250155[Server]: "..string.char(169).."255255255You can't shake higher staff") return false end parse("shake "..arg.." 900") msg(""..string.char(169).."000250155[Server]: "..string.char(169).."255255255"..player(id,"name").." Used shake on "..player(arg,"name").."") end end };