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

Weird function errors

tiddpd

PHP Scripter
Joined
Apr 16, 2008
Messages
331
Reaction score
0
Ok so I have just switched to TFS 0.3. In my scripts I have been having some retarted errors.

error number 1: doCreateItem(5138,1,thingPos)<--- tile can not be found ?!?!!!? I can see the tile clearly, I have the pos set right etc.

error number 2: doTransformItem(item.uid,1946) <--- I don't get any error messages, but the script does everything but transforms the item

error number 3: I have a talkaction script the when you say "open sesame" it removes this big rock in the way, it worked the first time i used it, when i put the rock back, it says item cannot be found:huh:
 
First one is: (movement)
Code:
local closePos = getThingfromPos({x = 457, y = 197, z = 7, stackpos=1})

function onStepIn(cid, item, position, fromPosition)
		doCreateItem(5138,1,closePos)
		doPlayerSendTextMessage(cid,22,"The door has shut behind you!")
end
Error: [04/02/2009 15:06:16] Lua Script Error: [MoveEvents Interface]
[04/02/2009 15:06:16] data/movements/scripts/sesameclose.lua:eek:nStepIn

Second one is: (lever action)
Code:
function onUse(cid, item, frompos, item2, topos)

	local statuePos = {x = 286, y = 95, z = 10, stackpos=1}
	local statuePos2 = {x = 286, y = 95, z = 10}
	local statue = getThingfromPos(statuePos)
	
	if item.itemid == 1945 then
		doRemoveItem(statue.uid,4444)
		doTransformItem(item.uid,1946)
		doPlayerSendTextMessage(cid,22,"Something has just magically disapeared.")
	elseif item.itemid == 1946 then
		doCreateItem(1467,1,statuePos2)
		doTransformItem(item.uid,1945) 
		doPlayerSendTextMessage(cid,22,"Something just magically appeared.")
	end
end

Third one is: (talkaction)
Code:
local standPos = {x=457,y=199,z=7}
local statue = getThingfromPos({x = 457, y = 198, z = 7, stackpos=1})

function onSay(cid, param)
    if comparePos(getPlayerPosition(cid), standPos) then
        if statue.itemid > 0 then
            doRemoveItem(statue.uid,1)
        else
            doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
        end
    end
    return 1
end
Error: [04/02/2009 15:08:06] data/talkactions/scripts/open.lua:eek:nSay

[04/02/2009 15:08:06] luaDoRemoveItem(). Item not found
 
Last edited:
Considering the lever thing: For me in TFS03.b3 it works without this part. I don't have to make the script flip the lever. It does that from itself. Like this:

PHP:
function onUse(cid, item, frompos, item2, topos)

	local statuePos = {x = 286, y = 95, z = 10, stackpos=1}
	local statue = getThingfromPos(statuePos)
	
	if item.itemid == 1945 then
		doRemoveItem(statue.uid,4444)
		doPlayerSendTextMessage(cid,22,"Something has just magically disapeared.")

	elseif item.itemid == 1946 then
		doCreateItem(1467, 1, statuePos)
		doPlayerSendTextMessage(cid,22,"Something just magically appeared.")
	end
end
 
Back
Top