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

help with mod plz

Thorn

Spriting since 2013
Joined
Sep 24, 2012
Messages
2,203
Solutions
1
Reaction score
923
Location
Chile
hiii, i have this mod

XML:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Inquisition"

version="2.0" author="Tommy" contact="[email protected]" enabled="yes">
<config name="inqusitionFunctions"><![CDATA[
config = {
    message = "Go into the teleporter in 3 minutes, else it will disappear.",
    timeToRemove = 180, -- seconds
    teleportId = 1387,
    MonStor = 48000,
    bosses = { -- Monster Name, Teleport To Position, Teleport Position, UID
        ["God of the Forest"] = { ptp={ x=857, y=552, z=6}, pp={ x=865, y=568, z=7, stackpos=1 }, uid=49100 },
        ["God of the Desert"] = { ptp={ x=856, y=554, z=5 }, pp={ x=862, y=567, z=6, stackpos=1 }, uid=49200 },
        ["God of Poison"] = { ptp={ x=857, y=554, z=4 }, pp={ x=868, y=569, z=5, stackpos=1 }, uid=49300 },
        ["God of Ice"] = { ptp={ x=897, y=599, z=3}, pp={ x=867, y=570, z=4, stackpos=1 }, uid=49400 },
        ["Supreme God"] = { ptp={ x=452, y=164, z=6 }, pp={ x=452, y=162, z=6, stackpos=1 }, uid=49500 },
            }
}
 
    function removal(position)
    if getThingfromPos(position).itemid == config.teleportId then
        doRemoveItem(getThingfromPos(position).uid)
    end
    return TRUE
end]]></config>

        <event type="login" name="inquisitionRegister" event="script"><![CDATA[
        domodlib('inqusitionFunctions')
        function onLogin(cid)
    registerCreatureEvent(cid, "Inquisition")
        return true
end]]></event>

    <event type="kill" name="Inquisition" event="script"><![CDATA[
function onKill(cid, target, lastHit)
    if(config.bosses[getCreatureName(target)]) then
        local t = config.bosses[getCreatureName(target)]
        local teleport = doCreateTeleport(config.teleportId, t.ptp, t.pp)
        local position = t.pp
        doItemSetAttribute(teleport, "uid", t.uid)
        doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
        addEvent(removal, config.timeToRemove * 1000, position)
    end
    return TRUE
end]]></event>


         <action fromuid="1301" touid="1311" event="script"><![CDATA[
        domodlib('inqusitionFunctions')
    local storage = 50301
    local inquisitionRewards = {
        [9988] = 8890, --a robe of the underworld
        [9989] = 8918, --a spellbook of dark mysteries
        [9990] = 8881, --a fireborn giant armor
        [9991] = 8888, --a master archer's armor
        [9992] = 8851, --a royal crossbow
        [9993] = 7435, --an executioner
        [9994] = 8929, --the stomper
        [9995] = 7417, --a runed sword
        [9996] = 8854, --a warsinger bow
        [9997] = 8903, --a spellbook of lost souls
        [9998] = 2508, --a mystical armor
        [9999] = 8905 --a rainbow shield
    }
    
    if inquisitionRewards[item.uid] then
        if getPlayerStorageValue(cid, storage) < 1 then
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found " .. getItemArticleById(inquisitionRewards[item.uid]) .. " " .. getItemNameById(inquisitionRewards[item.uid]) .. ".")
            doPlayerAddItem(cid, inquisitionRewards[item.uid], 1)
            setPlayerStorageValue(cid, storage, 1)
                                addPlayerRep(cid, 5, TEXTCOLOR_LIGHTBLUE)
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.") 
        end
    end
    
    return true
]]></action>
</mod>

but im only using the part where you kill a boss and a teleport appears, well is only working with the first boss and the last boss :S and no errors in console, plzz help me guys :(
 
Last edited:
try this:
LUA:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Inquisition"
 
version="2.0" author="Tommy" contact="[email protected]" enabled="yes">
<config name="inqusitionFunctions"><![CDATA[
config = {
    message = "Go into the teleporter in 3 minutes, else it will disappear.",
    timeToRemove = 180, -- seconds
    teleportId = 1387,
    MonStor = 48000,
    bosses = { -- Monster Name, Teleport To Position, Teleport Position, UID
        ["God of the Forest"] = { ptp={ x=857, y=552, z=6}, pp={ x=865, y=568, z=7, stackpos=1 }, uid=49100 },
        ["God of the Desert"] = { ptp={ x=856, y=554, z=5 }, pp={ x=862, y=567, z=6, stackpos=1 }, uid=49200 },
        ["God of Poison"] = { ptp={ x=857, y=554, z=4 }, pp={ x=868, y=569, z=5, stackpos=1 }, uid=49300 },
        ["God of Ice"] = { ptp={ x=897, y=599, z=3}, pp={ x=867, y=570, z=4, stackpos=1 }, uid=49400 },
        ["Supreme God"] = { ptp={ x=452, y=164, z=6 }, pp={ x=452, y=162, z=6, stackpos=1 }, uid=49500 },
            }
}
 
    function removal(position)
    if getThingfromPos(position).itemid == config.teleportId then
        doRemoveItem(getThingfromPos(position).uid)
    end
    return TRUE
end]]></config>
 
        <event type="login" name="inquisitionRegister" event="script"><![CDATA[
        domodlib('inqusitionFunctions')
        function onLogin(cid)
    registerCreatureEvent(cid, "Inquisition")
        return true
end]]></event>
 
    <event type="kill" name="Inquisition" event="script"><![CDATA[
function onKill(cid, target, lastHit)
    if(config.bosses[getCreatureName(target)]) then
        local t = config.bosses[getCreatureName(target)]
        local teleport = doCreateTeleport(config.teleportId, t.ptp, t.pp)
        local position = t.pp
         doSetItemActionId(teleport, t.uid)
        doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
        addEvent(removal, config.timeToRemove * 1000, position)
    end
    return TRUE
end]]></event>
 
 
         <action fromuid="1301" touid="1311" event="script"><![CDATA[
        domodlib('inqusitionFunctions')
    local storage = 50301
    local inquisitionRewards = {
        [9988] = 8890, --a robe of the underworld
        [9989] = 8918, --a spellbook of dark mysteries
        [9990] = 8881, --a fireborn giant armor
        [9991] = 8888, --a master archer's armor
        [9992] = 8851, --a royal crossbow
        [9993] = 7435, --an executioner
        [9994] = 8929, --the stomper
        [9995] = 7417, --a runed sword
        [9996] = 8854, --a warsinger bow
        [9997] = 8903, --a spellbook of lost souls
        [9998] = 2508, --a mystical armor
        [9999] = 8905 --a rainbow shield
    }
 
    if inquisitionRewards[item.uid] then
	  	  if getPlayerStorageValue(cid,storage) == -1 then
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found " .. getItemArticleById(inquisitionRewards[item.uid]) .. " " .. getItemNameById(inquisitionRewards[item.uid]) .. ".")
            doPlayerAddItem(cid, inquisitionRewards[item.uid], 1)
            setPlayerStorageValue(cid,storage,1)
            addPlayerRep(cid, 5, TEXTCOLOR_LIGHTBLUE)
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.") 
        end
    end
 
    return true
]]></action>
</mod>
 
no it didn't work and i had this error (the monster stays without hp but still there)
XML:
 Description: 
[13/08/2013 11:11:16] [string "loadBuffer"]:6: attempt to call global 'doSetItemActionId' (a nil value)
[13/08/2013 11:11:16] stack traceback:
[13/08/2013 11:11:16] 	[string "loadBuffer"]:6: in function <[string "loadBuffer"]:1>

[13/08/2013 11:11:17] [Error - CreatureScript Interface] 
[13/08/2013 11:11:17] buffer:onKill
[13/08/2013 11:11:17] Description: 
[13/08/2013 11:11:17] [string "loadBuffer"]:6: attempt to call global 'doSetItemActionId' (a nil value)
[13/08/2013 11:11:17] stack traceback:
[13/08/2013 11:11:17] 	[string "loadBuffer"]:6: in function <[string "loadBuffer"]:1>

[13/08/2013 11:11:18] [Error - CreatureScript Interface] 
[13/08/2013 11:11:18] buffer:onKill
[13/08/2013 11:11:18] Description: 
[13/08/2013 11:11:18] [string "loadBuffer"]:6: attempt to call global 'doSetItemActionId' (a nil value)
[13/08/2013 11:11:18] stack traceback:
[13/08/2013 11:11:18] 	[string "loadBuffer"]:6: in function <[string "loadBuffer"]:1>

[13/08/2013 11:11:19] [Error - CreatureScript Interface] 
[13/08/2013 11:11:19] buffer:onKill
[13/08/2013 11:11:19] Description: 
[13/08/2013 11:11:19] [string "loadBuffer"]:6: attempt to call global 'doSetItemActionId' (a nil value)
[13/08/2013 11:11:19] stack traceback:
[13/08/2013 11:11:19] 	[string "loadBuffer"]:6: in function <[string "loadBuffer"]:1>

[13/08/2013 11:11:19] [Error - CreatureScript Interface] 
[13/08/2013 11:11:20] buffer:onKill
[13/08/2013 11:11:20] Description: 
[13/08/2013 11:11:20] [string "loadBuffer"]:6: attempt to call global 'doSetItemActionId' (a nil value)
[13/08/2013 11:11:20] stack traceback:
 
try
LUA:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Inquisition"
 
version="2.0" author="Tommy" contact="[email protected]" enabled="yes">
<config name="inqusitionFunctions"><![CDATA[


local config = {
        timeToRemove = 180, -- seconds
		message = "Go into the teleporter in 3 minutes, else it will disappear.",
        teleportId = 1387,
        MonStor = 48000,
        bosses = { -- Monster Name,  Teleport Position
                ["God of the Forest"] = {  pos={ x=857, y=552, z=6, stackpos=1 }, aid=49100 },
				["God of the Desert"] = {  pos={ x=856, y=554, z=5, stackpos=1 }, aid=49200}, 
				["God of Poison"] = {  pos={ x=857, y=554, z=4, stackpos=1 }, aid=49300}, 
                ["God of Ice"] = {  pos={ x=897, y=599, z=3, stackpos=1 }, aid=49400},
                ["Supreme God"] = {  pos={ x=452, y=164, z=6, stackpos=1 }, aid=49500}
                 }
                 
    local function removal(position)
	doRemoveThing(getTileItemById(position, config.teleportId).uid, 1) 

    return TRUE
end ]]></config>
 
        <event type="login" name="inquisitionRegister" event="script"><![CDATA[
        domodlib('inqusitionFunctions')
        function onLogin(cid)
    registerCreatureEvent(cid, "Inquisition")
        return true
end]]></event>
 
    <event type="kill" name="Inquisition" event="script"><![CDATA[
function onKill(cid, target, lastHit)
    if(config.bosses[getCreatureName(target)]) then
        local t = config.bosses[getCreatureName(target)]
        local teleport = doCreateTeleport(config.teleportId, t.ptp, t.pp)
        local position = t.pp
        doItemSetAttribute(teleport, "uid", t.uid)
        doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
        addEvent(removal, config.timeToRemove * 1000, position)
    end
    return TRUE
end]]></event>
 
 
         <action fromuid="1301" touid="1311" event="script"><![CDATA[
        domodlib('inqusitionFunctions')
    local storage = 50301
    local inquisitionRewards = {
        [9988] = 8890, --a robe of the underworld
        [9989] = 8918, --a spellbook of dark mysteries
        [9990] = 8881, --a fireborn giant armor
        [9991] = 8888, --a master archer's armor
        [9992] = 8851, --a royal crossbow
        [9993] = 7435, --an executioner
        [9994] = 8929, --the stomper
        [9995] = 7417, --a runed sword
        [9996] = 8854, --a warsinger bow
        [9997] = 8903, --a spellbook of lost souls
        [9998] = 2508, --a mystical armor
        [9999] = 8905 --a rainbow shield
    }
 
    if inquisitionRewards[item.uid] then
        if getPlayerStorageValue(cid, storage) < 1 then
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found " .. getItemArticleById(inquisitionRewards[item.uid]) .. " " .. getItemNameById(inquisitionRewards[item.uid]) .. ".")
            doPlayerAddItem(cid, inquisitionRewards[item.uid], 1)
            setPlayerStorageValue(cid, storage, 1)
                                addPlayerRep(cid, 5, TEXTCOLOR_LIGHTBLUE)
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.") 
        end
    end
 
    return true
    end
]]></action>
</mod>


what version TFS use you?
 
let me test the last one, is just i have my server running and it's a pain in the ass if the server crashes D: i'll test it now

- - - Updated - - -

damn i got a c++ debug :/!!!!

- - - Updated - - -

XML:
[13/08/2013 12:55:20] Description: 
[13/08/2013 12:55:20] [string "..."]:16: '}' expected (to close '{' at line 3) near 'local'
 
are you have same error in this?
LUA:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Inquisition"
version="2.0" author="Tommy" contact="[email protected]" enabled="yes">
<config name="inqusitionFunctions"><=!=[=C=D=A=T=A=[
 
 
local config = {
        timeToRemove = 180, -- seconds
        message = "Go into the teleporter in 3 minutes, else it will disappear.",
        teleportId = 1387,
        MonStor = 48000,
        bosses = { -- Monster Name,  Teleport Position
                ["God of the Forest"] = {  pos={ x=857, y=552, z=6, stackpos=1 }, aid=49100 },
                ["God of the Desert"] = {  pos={ x=856, y=554, z=5, stackpos=1 }, aid=49200}, 
                ["God of Poison"] = {  pos={ x=857, y=554, z=4, stackpos=1 }, aid=49300}, 
                ["God of Ice"] = {  pos={ x=897, y=599, z=3, stackpos=1 }, aid=49400},
                ["Supreme God"] = {  pos={ x=452, y=164, z=6, stackpos=1 }, aid=49500},
            }
}
 
    local function removal(position)
    doRemoveThing(getTileItemById(position, config.teleportId).uid, 1) 
 
    return TRUE
end ]=]=></config>
 
        <event type="login" name="inquisitionRegister" event="script"><=!=[=C=D=A=T=A=[
        domodlib('inqusitionFunctions')
        function onLogin(cid)
    registerCreatureEvent(cid, "Inquisition")
        return true
end]=]=></event>
 
    <event type="kill" name="Inquisition" event="script"><=!=[=C=D=A=T=A=[
function onKill(cid, target, lastHit)
    if(config.bosses[getCreatureName(target)]) then
        local t = config.bosses[getCreatureName(target)]
        local teleport = doCreateTeleport(config.teleportId, t.ptp, t.pp)
        local position = t.pp
        doItemSetAttribute(teleport, "aid", t.aid)
        doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
        addEvent(removal, config.timeToRemove * 1000, position)
    end
    return TRUE
end]=]=></event>
 
 
         <action fromuid="1301" touid="1311" event="script"><=!=[=C=D=A=T=A=[
        domodlib('inqusitionFunctions')
    local storage = 50301
    local inquisitionRewards = {
        [9988] = 8890, --a robe of the underworld
        [9989] = 8918, --a spellbook of dark mysteries
        [9990] = 8881, --a fireborn giant armor
        [9991] = 8888, --a master archer's armor
        [9992] = 8851, --a royal crossbow
        [9993] = 7435, --an executioner
        [9994] = 8929, --the stomper
        [9995] = 7417, --a runed sword
        [9996] = 8854, --a warsinger bow
        [9997] = 8903, --a spellbook of lost souls
        [9998] = 2508, --a mystical armor
        [9999] = 8905 --a rainbow shield
    }
 
    if inquisitionRewards[item.uid] then
        if getPlayerStorageValue(cid, storage) < 1 then
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found " .. getItemArticleById(inquisitionRewards[item.uid]) .. " " .. getItemNameById(inquisitionRewards[item.uid]) .. ".")
            doPlayerAddItem(cid, inquisitionRewards[item.uid], 1)
            setPlayerStorageValue(cid, storage, 1)
                                addPlayerRep(cid, 5, TEXTCOLOR_LIGHTBLUE)
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.") 
        end
    end
 
    return true
    end
]=]=></action>
</mod>
 
damn now i'm afraid to test it, i will let you know when i test it (because i've my server running :S)
 
I not understand not is big problem make reload and say me have error or works

What did you don't understand?
He didn't wanna try it right on because his server is running, in case he get some crashes or something.
I think like this all the time before to lol
 
Thanks Cornex, of couse, the players get bored if the server crashes too many times :/ if i try a new script that may crash my server i do it too late or too early

- - - Updated - - -

LUA:
[15/08/2013 02:56:27] > Loading inquisition.xml...[Error - ScriptingManager::loadFromXml] Cannot load mod mods/inquisition.xml
[15/08/2013 02:56:27] Line: 67, Info: StartTag: invalid element name
 
Back
Top