1. The command !resetscore so evryone can reset hes score
2. !nobots sometimes i add bots so i need the command !nobots if the users dont like them so they can kick them
addhook("say","cmds")
function cmds(p,t)
if(t=="!resetscore") then
parse("setscore "..p.." 0")
parse("setdeaths "..p.." 0")
elseif(t=="!nobots") then
for _,v in pairs(player(0,"table")) do
if(player(v,"bot")==true) then
parse("kick "..v)
end
end
end
end
local lockt = false
local lockct = false
addhook("say","cmds")
function cmds(p,t)
if(t=="!resetscore") then
parse("setscore "..p.." 0")
parse("setdeaths "..p.." 0")
elseif(t=="!nobots") then
for _,v in pairs(player(0,"table")) do
if(player(v,"bot")==true) then
parse("kick "..v)
end
end
elseif(t=="@lockt") then
lockt = true
elseif(t=="@lockct") then
lockct = true
elseif(t=="@unlockall") then
lockt = false
lockct = false
end
end
addhook("team","change")
function change(id, team)
if (player(id,"team")) == 1 then
if lockt == true then
return 1
end
elseif(player(id,"team")) == 2 then
if lockct == true then
return 1
end
end
end
lockt = false
lockct = false
addhook("say","cmds")
function cmds(p,t)
if(t=="!resetscore") then
parse("setscore "..p.." 0")
parse("setdeaths "..p.." 0")
elseif(t=="!nobots") then
for _,v in pairs(player(0,"table")) do
if(player(v,"bot")==true) then
parse("kick "..v)
end
end
elseif(t=="@lockt") then
lockt = true
elseif(t=="@lockct") then
lockct = true
elseif(t=="@unlockall") then
lockt = false
lockct = false
end
end
addhook("team","change")
function change(id, team)
if (player(id,"team")) == 1 then
if lockt == true then
return 1
end
elseif(player(id,"team")) == 2 then
if lockct == true then
return 1
end
end
end
lockt = false
lockct = false
addhook("say","cmds")
function cmds(p,t)
if(t=="!resetscore") then
parse("setscore "..p.." 0")
parse("setdeaths "..p.." 0")
msg(player(p,"name").." has reset their score.")
elseif(t=="!nobots") then
for _,v in pairs(player(0,"table")) do
if(player(v,"bot")==true) then
parse("kick "..v)
end
end
msg("All bots have been removed.")
elseif(t=="@lockt") then lockt = true
elseif(t=="@lockct") then lockct = true
elseif(t=="@unlockall") then
lockt = false
lockct = false
else return 0 end
return 1
end
addhook("team","change")
function change(id, team)
if team == 1 then
if lockt == true then
msg2(id,"©255000000This team is locked!")
return 1
end
elseif team == 2 then
if lockct == true then
msg2(id,"©255000000This team is locked!")
return 1
end
end
end