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

Bug with doSetItemSpecialDescription [0.3.6]

Meferot

New Member
Joined
Jan 28, 2008
Messages
57
Reaction score
1
It's my script:
PHP:
function onStepIn(cid, item, position, fromPosition)
	local gobletPos = getThingPos(item.uid)
	if item.actionid == 8649 then
		if getPlayerStorageValue(cid, 8649) ~= 1 then
			setPlayerStorageValue(cid, 8649, 1)
			local goblet = doCreateItemEx(5785, 1)
			doSetItemSpecialDescription(goblet, "It is given to the courageous victor of the gravedigger mission.\nAwarded to " .. getCreatureName(cid) .. ".")
			doTileAddItemEx({x=gobletPos.x,y=gobletPos.y-1,z=gobletPos.z}, goblet)
		end
	end
	return TRUE
end

And this is an error:
PHP:
[20/12/2009 11:43:35] [Error - MoveEvents Interface] 
[20/12/2009 11:43:35] data/movements/scripts/medal_of_honour.lua:onStepIn
[20/12/2009 11:43:35] Description: 
[20/12/2009 11:43:35] data/movements/scripts/medal_of_honour.lua:7: attempt to call global 'doSetItemSpecialDescription' (a nil value)
[20/12/2009 11:43:35] stack traceback:
[20/12/2009 11:43:35] 	data/movements/scripts/medal_of_honour.lua:7: in function <data/movements/scripts/medal_of_honour.lua:1>

How to fix it? ;p
I using tfs 0.3.6
 
Try this one:
Code:
function onStepIn(cid, item, position, fromPosition)
    local gobletPos = getThingPos(item.uid)
    local addpos = {x=gobletPos.x,y=gobletPos.y-1,z=gobletPos.z}
    if item.actionid == 8649 then
        if getPlayerStorageValue(cid, 8649) ~= 1 then
            setPlayerStorageValue(cid, 8649, 1)
            local goblet = doCreateItem(5785,1, addpos)
            doSetItemSpecialDescription(goblet, "It is given to the courageous victor of the gravedigger mission.\nAwarded to " .. getCreatureName(cid) .. ".")
        end
    end
    return TRUE
end
 
doItemSetAttribute(goblet, "description", "It is given to the courageous victor of the gravedigger mission.\nAwarded to " .. getCreatureName(cid) .. ".")
 
Just add to your functions:
Lua:
function doSetItemSpecialDescription(uid, text)
     return doItemSetAttribute(uid, "description", text)
end
 
Back
Top