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

Need Help with script creaturescripts

theBroken

New Member
Joined
Nov 11, 2016
Messages
25
Reaction score
4
yn3oiTE
I Create new quest , I create boss and add script when kill boss create teleport
Code:
local config =
{
    time = 60, -- seconds
    teleportId = 5023,
    bosses =
    { -- Monster Name,  Teleport Position, aid, optional brothers name
        ["Desintegrated Ghazbaran"] = {  pos={ x=247, y=617, z=6}, aid=12666},
    }
}
local function changeBack(position)
    doItemSetAttribute(getTileItemById(t.pos, config.teleportId).uid, "aid", 3000)
end
function onKill(cid, target, lastHit)
    if(config.bosses[getCreatureName(target)]) then
        if config.bosses[getCreatureName(target)].brother then if(isMonster(getCreatureByName(config.bosses[getCreatureName(target)].brother))) then return true end end
        doItemSetAttribute(getTileItemById(config.bosses[getCreatureName(target)].pos, config.teleportId).uid, "aid", config.bosses[getCreatureName(target)].aid)
        doCreatureSay(cid, "Go into the teleport in "..config.timeToRemove.." seconds, else it will disappear.", TALKTYPE_MONSTER_SAY)
        addEvent(changeBack, config.time * 1000, t.pos)
    end
    return true
end
And creaturescripts.xml table
<event type="kill" name="Ghaz" event="script" value="script.lua"/>
When i kill boss, boss dont move dont have name and hp and attack me
yn3oiTE.png

yn3oiTE

Code:
Errors in .exe
[Error - CreatureScript Interface]
Description:
<luaDoItemSetAtribute> Item not found
data/creaturescripts/scripts/script.lua:onKill
Description:
data/creaturescripts/scripts/script.lua:17: attempt to concatenate field 'timeToRemove' <a nil value>
stack traceback:
data/creaturescripts/scripts/script.lua:17: in function <data/creaturescripts/scripts/script.lua:13>
 
Ok i change it and when i kill boss i have Tibia Debug and errors on tfs.exe
Code:
[Error - Creaturescript Interface]
data/creaturescripts/scripts/script.lua:18 attempt to index global "t" <a nil value>
stack traceback:
data/creaturescripts/scripts/script.lua:18 in function <data/creaturescripts/scripts/script.lua:13>


Script.lua
Code:
local config =
{
    time = 60, -- seconds
    teleportId = 5023,
    bosses =
    { -- Monster Name,  Teleport Position, aid, optional brothers name
        ["Desintegrated Ghazbaran"] = {  pos={ x=247, y=617, z=6}, aid=12666},
    }
}
local function changeBack(position)
    doItemSetAttribute(getTileItemById(t.pos, config.teleportId).uid, "aid", 3000)
end
function onKill(cid, target, lastHit)
    if(config.bosses[getCreatureName(target)]) then
        if config.bosses[getCreatureName(target)].brother then if(isMonster(getCreatureByName(config.bosses[getCreatureName(target)].brother))) then return true end end
        doItemSetAttribute(getTileItemById(config.bosses[getCreatureName(target)].pos, config.teleportId).uid, "aid", config.bosses[getCreatureName(target)].aid)
        doCreatureSay(cid, "Go into the teleport in "..config.time.." seconds, else it will disappear.", TALKTYPE_MONSTER_SAY)
        addEvent(changeBack, config.time * 1000, t.pos)
    end
    return true
end

Can anyone help me ?
please rework the entire script
I give Rep+ when work
 
Ok i change it and when i kill boss i have Tibia Debug and errors on tfs.exe
Code:
[Error - Creaturescript Interface]
data/creaturescripts/scripts/script.lua:18 attempt to index global "t" <a nil value>
stack traceback:
data/creaturescripts/scripts/script.lua:18 in function <data/creaturescripts/scripts/script.lua:13>


Script.lua
Code:
local config =
{
    time = 60, -- seconds
    teleportId = 5023,
    bosses =
    { -- Monster Name,  Teleport Position, aid, optional brothers name
        ["Desintegrated Ghazbaran"] = {  pos={ x=247, y=617, z=6}, aid=12666},
    }
}
local function changeBack(position)
    doItemSetAttribute(getTileItemById(t.pos, config.teleportId).uid, "aid", 3000)
end
function onKill(cid, target, lastHit)
    if(config.bosses[getCreatureName(target)]) then
        if config.bosses[getCreatureName(target)].brother then if(isMonster(getCreatureByName(config.bosses[getCreatureName(target)].brother))) then return true end end
        doItemSetAttribute(getTileItemById(config.bosses[getCreatureName(target)].pos, config.teleportId).uid, "aid", config.bosses[getCreatureName(target)].aid)
        doCreatureSay(cid, "Go into the teleport in "..config.time.." seconds, else it will disappear.", TALKTYPE_MONSTER_SAY)
        addEvent(changeBack, config.time * 1000, t.pos)
    end
    return true
end

Can anyone help me ?
please rework the entire script
I give Rep+ when work
Code:
local config =
{
    time = 60, -- seconds
    teleportId = 5023,
    bosses = { -- Monster Name,  Teleport Position, aid, optional brothers name
        ["Desintegrated Ghazbaran"] = {pos= {x = 247, y = 617, z = 6}, aid = 12666},
    }
}
local function changeBack(position)
    doItemSetAttribute(getTileItemById(position, config.teleportId).uid, "aid", 3000)
end
function onKill(cid, target, lastHit)
    local t = config.bosses[getCreatureName(target)]
    if t then
        if t.brother and isMonster(getCreatureByName(t.brother)) then
            return true 
        end
        doItemSetAttribute(getTileItemById(t.pos, config.teleportId).uid, "aid", t.aid)
        doCreatureSay(cid, "Go into the teleport in "..config.time.." seconds, else it will disappear.", TALKTYPE_MONSTER_SAY)
        addEvent(changeBack, config.time * 1000, t.pos)
    end
    return true
end
 
I have tibia debug and error on tfs.exe
Code:
[Error - Creaturescript Interface]
data/creaturescripts/scripts/script.lua:OnKill
Description:
<luaDoItemSetAttribute> Item not found
Here creaturescripts.xml table
Code:
<event type="kill" name="Ghaz" event="script" value="script.lua"/>

HOW CHANGE THIS?
REP for help!
 
I have tibia debug and error on tfs.exe
Code:
[Error - Creaturescript Interface]
data/creaturescripts/scripts/script.lua:OnKill
Description:
<luaDoItemSetAttribute> Item not found
Here creaturescripts.xml table
Code:
<event type="kill" name="Ghaz" event="script" value="script.lua"/>

HOW CHANGE THIS?
REP for help!
create the teleport before it sets the attribute
 
Back
Top