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

Lua Why this code doesn't work? ( simple problem )

Guxi

Developer
Joined
Mar 17, 2012
Messages
128
Reaction score
12
Location
Croatia
I made a action script: when you click on snake head, a wall will be deleted. When you click it again, the wall will be created. ( like lever & bridge )


Code:
function onUse(cid, item, frompos, item2, topos)
    tile1 = {x=1145, y=828, z=8, stackpos=1} --change tilepos
    
   
    gettile1 = getThingfromPos(tile1)
    
   

    if item.uid == 8300 and item.itemid == 5058 then
		doTransformItem(item.uid,item.itemid-1)
        doRemoveItem(gettile1.uid,1)
        
        
        
        doTransformItem(item.uid,item.itemid-1)
    elseif item.uid == 8300 and item.itemid == 5057 then
        doCreateItem(9119,1,tile1) --change itemID
        
	
        
        
        doTransformItem(item.uid,item.itemid+1)        
    else
        doPlayerSendCancel(cid,"Sorry, not possible.")
    end

    return 1
end

Code:
<action uniqueid="3800" script="stonewall.lua" />


TFS 0.3.6 8.60 V7 edited by Cyko

- - - Updated - - -

I get no errors in TFS console?!
 
use getTileItemById(tile1, 5058) instead of getThingfromPos(tile1)
should find id on tile without using stackpos
 
Back
Top