• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Problem with script

ScorpiOOn93

etherno.net
Joined
Jun 19, 2008
Messages
662
Reaction score
1
Location
CookieLand :DDD
Hello.
I have a anty-bot script in globalevents, but I want to edit it so it will ban the players.

The script:
Code:
 local AnswerStor = 14365
local AnswerOK = 14366

function ContinueAFKCheckAction(x)
if isPlayer(x.cid) == TRUE then
local AnswerOKValue = getPlayerStorageValue(x.cid, AnswerOK)
setPlayerStorageValue(x.cid, AnswerStor, 0)
setPlayerStorageValue(x.cid, AnswerOK, 0)
if AnswerOKValue ~= 1 then
[b]doRemoveCreature(x.cid)[/b]
end
end
end

function StartAFKCheckAction(x)
if isPlayer(x.cid) == TRUE then
local value1, value2 = math.random(5,20), math.random(5,20)
local Answer = value1 + value2
doPlayerSendTextMessage(x.cid, 22, "" .. value1 .." + " .. value2 .." = ?? <-- Utilixa /responder xx")
setPlayerStorageValue(x.cid, AnswerStor, Answer)
addEvent(ContinueAFKCheckAction, 1 * 1000 * 60, {cid = x.cid})
end
end

function onThink(interval, lastExecution)
local PlayersOnline = getPlayersOnline()
for i, pid in ipairs(PlayersOnline) do
local Continue = TRUE
if getCreatureSkullType(pid) > 0 then
local Target = getCreatureTarget(pid)
if Target ~= nil then
if isPlayer(Target) == TRUE then
Continue = FALSE
end
end
elseif getPlayerAccess(pid) >= 3 then
Continue = FALSE
end
if Continue == TRUE then
addEvent(StartAFKCheckAction, 1 * 1000 * 60, {cid = pid})
end
end
return TRUE
end

I was trying with a lot combination but always it wasn't working without any errors in console :/

Where is doRemoveCreature(x.cid) there should be "doAddAccountBanishment" or w/e
 
Back
Top