• 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 Sumon By Lever

Elexonic

Well-Known Member
Joined
Jun 18, 2008
Messages
1,920
Reaction score
59
I need scrtip for sumons monster by lever
anyone has any good?
with exhausted and without fault ?¿
 
Last edited:
LUA:
local config = {
	leverUid = 1234, -- lever UniqueID
	leverPos = {x=54, y=56, z=8, stackpos=1}, -- lever pos
	monsterPos = {x=52, y=56, z=8, stackpos=1}, -- monster pos
	nameMonster = "Demon", -- monster name
	effect = CONST_ME_TELEPORT, -- effect when lever appears/disappear
	messageTwo = "Sorry, not possible.", -- message that returns when player pull on the lever until lever back off
	timeRemove = 5, -- Time, in seconds to 'exaust'
}


function onUse(cid, item, frompos, item2, topos, position)
	if item.uid == config.leverUid and item.itemid == 1945 then
	doCreateMonster(config.nameMonster, config.monsterPos, true)
			doSendMagicEffect(config.monsterPos, config.effect)
		addEvent(returnLever, config.timeRemove * 1000)
	elseif item.uid == config.leverUid and item.itemid == 1946 then 
	doPlayerSendCancel(cid, config.messageTwo)
	return TRUE
	end
end



function returnLever() 
    if getThingfromPos(config.leverPos).uid > 0 then
        doTransformItem(getThingfromPos(config.leverPos).uid, 1945)
		doSendMagicEffect(config.leverPos, CONST_ME_POFF)
	end
end
 
Last edited:
Error-->


[error action-interface]
in a timer event called from:
test2.lua:onUse
<luadotransformItem> Item not found
 
Code:
				local monsterPos = {x=2189, y=1419, z=7}
 local uid = {
			[3001] = {'monster name'},
			[3002] = {'monster name'},

 }
		function onUse(cid, item, fromPosition, itemEx, toPosition)
		 local v = uid[item.uid]
		 doCreateMonster(v[1], monsterPos2)
		 doSendMagicEffect(monsterPos2, 10)
		return true
		end
 
the lever is on the floor. and I got up and gave him several times and there was when I got the error.
I want to give him a few times but not of failure.
 
Back
Top