• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Task problem

Imfreezing

Krossa Kapitalismen
Joined
Jun 7, 2012
Messages
1,009
Solutions
1
Reaction score
88
Location
Edron
Hello otland i have this script
http://pastebin.com/kt4K0xv1
But when you kill a rotworm nothing happends and if you are saying "Mission" it says you have killed 0 out of 100 rotworms. what may cause this problem? No errors in console

ALL help appriacted thanks!!
 
Show us your login.lua in craeturescripts/scripts
Code:
<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>
    <event type="login" name="PlayerLogin" event="script" value="login.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="advance" event="script" value="advance.lua"/>
        <event type="look" name="RebirthDescription" event="script" value="rebirthdescription.lua"/>

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

function onLogin(cid)
    if (getConfigValue("accountManager") == FALSE and getCreatureName(cid) == "Account Manager") then
        return false
    end

    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, "advance")
        registerCreatureEvent(cid, "onPrepareDeath")
        registerCreatureEvent(cid, "ZombieAttack")
        registerCreatureEvent(cid, "RedSkullAmulet")
        registerCreatureEvent(cid, "RebirthDescription")
    registerCreatureEvent(cid,'SpellUp')


    registerCreatureEvent(cid, "Idle")
    if(config.useFragHandler) then
        registerCreatureEvent(cid, "SkullCheck")
    end

    registerCreatureEvent(cid, "ReportBug")
    registerCreatureEvent(cid, "AdvanceSave")
    return true
end
 
Where did you get that script? There seem to be files missing.

Normally you have one NPC to handle quest start / end / status. You also have one script handling the storage when killing creatures, that would be a creaturescript.

Ignazio
 
Did you add these lines into their respective file?

Code:
Paste this in login.lua:
[code=lua] registerCreatureEvent(cid, "KillingInTheNameOf")

And this in creaturescripts.xml:
XML:
 <event type="kill" name="KillingInTheNameOf" event="script" value="killinginthenameof.lua"/>
[/CODE]

Just for clarity, can you show me those files you showed me, but the updated versions of them?

Ignazio
 
Did you add these lines into their respective file?

Code:
Paste this in login.lua:
[code=lua] registerCreatureEvent(cid, "KillingInTheNameOf")

And this in creaturescripts.xml:
XML:
 <event type="kill" name="KillingInTheNameOf" event="script" value="killinginthenameof.lua"/>
[/CODE]

Just for clarity, can you show me those files you showed me, but the updated versions of them?

Ignazio
Code:
<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>
    <event type="login" name="PlayerLogin" event="script" value="login.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="kill" name="KillingInTheNameOf" event="script" value="killinginthenameof.lua"/>
    <event type="advance" name="advance" event="script" value="advance.lua"/>
        <event type="look" name="RebirthDescription" event="script" value="rebirthdescription.lua"/>

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

function onLogin(cid)
    if (getConfigValue("accountManager") == FALSE and getCreatureName(cid) == "Account Manager") then
        return false
    end

    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, "advance")
        registerCreatureEvent(cid, "onPrepareDeath")
        registerCreatureEvent(cid, "ZombieAttack")
        registerCreatureEvent(cid, "RedSkullAmulet")
        registerCreatureEvent(cid, "KillingInTheNameOf")
        registerCreatureEvent(cid, "RebirthDescription")
    registerCreatureEvent(cid,'SpellUp')


    registerCreatureEvent(cid, "Idle")
    if(config.useFragHandler) then
        registerCreatureEvent(cid, "SkullCheck")
    end

    registerCreatureEvent(cid, "ReportBug")
    registerCreatureEvent(cid, "AdvanceSave")
    return true
end
Then ofc the file Killinginnameof...
Appriacte that you are helping me :)
 
Looks good to me, make sure you reload creaturescripts and NPCs after inserting the lines. As well as relogging after reloading.

Then you can try to write this line:
Code:
print(1)

Right below the onKill(...) function and look at the console to see if the script was found.

Ignazio
 
Back
Top