• 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!

Problems with creaturescripts on 0.3.6

Slime

Active Member
Joined
Jan 25, 2014
Messages
115
Reaction score
33
For some reason there's kind of "limit" for creaturescripts or something, so when I add a new creaturescripts, one of the previous scripts just stops working. I didn't use that much creaturescripts until now. Tibiando just stopped sending music and level points system stopped adding points on advance, when I added two on combat scripts.
CREATURESCRIPTS
Code:
<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>
    <event type="login" name="PlayerLogin" event="script" value="login.lua"/>
    <event type="login" name="start_audio" script="start_audio.lua"/>
    <event type="logout" name="Logout" script="logout.lua"/>
    <event type="preparedeath" name="Arenadie" event="script" value="arenadie.lua"/>

    <event type="joinchannel" name="GuildMotd" event="script" value="guildmotd.lua"/>
    <event type="receivemail" name="Mail" event="script" value="mail.lua"/>
    <event type="reportbug" name="SaveReportBug" script="reportbug.lua"/>
    <event type="advance" name="AdvanceSave" event="script" value="advancesave.lua"/>
   
    <event type="combat" name="Attackanimation" event="script" value="attackanim.lua"/>
    <event type="combat" name="Attackoutfit" event="script" value="attackoutfit.lua"/>
    <event type="combat" name="Attacksound" event="script" value="attacksound.lua"/>


    <event type="think" name="Idle" event="script" value="idle.lua"/>
    <event type="think" name="SkullCheck" event="script" value="skullcheck.lua"/>
</creaturescripts>
LOGIN.LUA
Code:
local config = {
    loginMessage = getConfigValue('loginMessage'),
    useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}

function onLogin(cid)
    local loss = getConfigValue('deathLostPercent')
    if(loss ~= nil) then
        doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
    end

    local accountManager = getPlayerAccountManager(cid)
    if(accountManager == MANAGER_NONE) then
        local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
        if(lastLogin > 0) then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
            str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
        else
            str = str .. " Please choose your outfit."
            doPlayerSendOutfitWindow(cid)
        end

        doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
    elseif(accountManager == MANAGER_NAMELOCK) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
    elseif(accountManager == MANAGER_ACCOUNT) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
    end

    if(not isPlayerGhost(cid)) then
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
    end

    registerCreatureEvent(cid, "Mail")
    registerCreatureEvent(cid, "GuildMotd")
    registerCreatureEvent(cid, "Idle")
    registerCreatureEvent(cid, "Attackanimation")
    registerCreatureEvent(cid, "Attackoutfit")
    registerCreatureEvent(cid, "Attacksound")
    registerCreatureEvent(cid, "Arenadie")
    registerCreatureEvent(cid, "Logout")
    if(config.useFragHandler) then
        registerCreatureEvent(cid, "SkullCheck")
    end

    registerCreatureEvent(cid, "ReportBug")
    registerCreatureEvent(cid, "AdvanceSave")
    return true
end
if not dj then
dj = startAPI(7173) -- Here start the audio
end
 
@EvilSkillz
That's not the case, something else must be wrong. I thought it might be console error caused by skullcheck.lua, so I deleted it. What I get now is:
Code:
[13/05/2014 00:12:04] [Error - CreatureScript Interface] 
[13/05/2014 00:12:04] In a timer event called from: 
[13/05/2014 00:12:04] data/creaturescripts/scripts/idle.lua
[13/05/2014 00:12:04] Description: 
[13/05/2014 00:12:04] (luaAddEvent) Callback parameter should be a function.
I didn't have this error before.
 
Sure, I did. I think when it goes to sounds I'll just move to OTClient, but there's other stuff constantly screwing up (like idle.lua error out of fucking nowhere). At least point system started working again.
 
Back
Top