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

[Help] Lever removes/chaning something...

krille09

Belden
Joined
Aug 15, 2007
Messages
4,892
Reaction score
55
Location
Stockholm, Sweden
PHP:
function onUse(cid, item, frompos, item2, topos)

	if(item.uid == 58115)then
		rItem = getThingfromPos({x=32603, y=32216, z=9, stackpos=255}).uid
		rItem2 = getThingfromPos({x=32604, y=32216, z=9, stackpos=255}).uid
		if(rItem > 0 and rItem2 > 0)then
        doRemoveItem(rItem, 1)
        doRemoveItem(rItem2, 1)
		end
	end
end

this is just a short script... but i wanna do it abit better :p

but I need if put fist ring (id: 2166) on X SQM or X unique id (dno what is best)

then remove...
 
This is a simple script I created to try something like this myself a few days ago:

"SacrificePos" is where you put the item you want to sacrifice in order to trigger the action.
"TeleportTo" in this case is the destination where you will be teleported when you successfully sacrificed the item.
"Sacrifice.itemid == xxxx" is the item ID of the item to be sacrificed.

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

local sacrificePos	= {x=530, y=410, z=11, stackpos=1}
local sacrifice		= getThingfromPos(sacrificePos)
local teleportTo	= {x=522, y=412, z=12}

	if item.itemid == 1945 then

		if sacrifice.itemid == 2149 then

			doSendMagicEffect(sacrificePos, CONST_ME_HITBYFIRE)
			doTeleportThing(cid, teleportTo)
			doSendMagicEffect(teleportTo, CONST_ME_ENERGYAREA)
			doRemoveItem(sacrifice.uid, 1)

		else

			doPlayerSendCancel(cid, "Sorry, not Possible.")
			return 1

		end

	end

end

You will need to create a lever on your map with a uniqueID and assign the script to this uniqueID in actions.xml.

If you don't want the player to be teleported somewhere just change that part to whatever you want the script to do. :)

I have only tested this script on the latest TFS so I can't guarantee you it will work instantly on other distros.
 
Back
Top