• 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 Make lever decay

ziggy46802

Active Member
Joined
Aug 19, 2012
Messages
418
Reaction score
27
Here is my script

goldtoplat.lua:
Code:
	function onUse(cid, item, fromPosition, itemEx, toPosition)
		if getPlayerItemCount(cid, 2148) >= 100 then
			doPlayerRemoveItem(cid,2148,100)
			doPlayerAddItem(cid,2152,1)
                        doSendMagicEffect(getPlayerPosition(cid), 13)			
		end
	return true
end

Here it is in actions.xml
Code:
<action actionid="3333" script="goldtoplat.lua"/>

What do I need to add to make the lever turn when you use it and if you dont have 100 of the item, the lever does not turn.
 
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == 1945 then
		if getPlayerItemCount(cid, 2148) >= 100 then
			doPlayerRemoveItem(cid,2148,100)
			doPlayerAddItem(cid,2152,1)
                        doSendMagicEffect(getPlayerPosition(cid), 13)			
			doTransformItem(item.uid, item.itemid+1)
		else
			doPlayerSendTextMessage(cid, 25, "Sorry, You need 100 gold coins.")
		end
	elseif item.itemid == 1946 then
		doTransformItem(item.uid, item.itemid-1)	
	end
	return true
end
 
Back
Top