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

Sacrifice teleport script

Hmpfot

New Member
Joined
Apr 19, 2009
Messages
72
Reaction score
0
Hello mate's!

I need a script that teleports me when ive been sacrificing an item
too be more exactly i want it like this:


When i put a ROYAL HELMET (id 2498) on a (empty coal basin, id 1485) sacrifice table located at x=1285 Y=1065 z=9 and then stand on a stone tile located at x=1285 y=1067 z=9 and then pull a lever infront of me located at x=1285 y=1066 z=9

then i wanna be teleported too another room, this location x=1225 y=1056 z=10


the royal helmet should dissapear and u need too sacrifice a new one next time you wanna go to this room


Someone can help me with this script?

And btw since im still nooby on scripting ETC i need help with ALL files that includes XML files /lua files yea i need help with all :)

would be very kind if someone could help me with this :)


Thx

Hmpf~
 
Add this to your actions.xml:
Code:
	<action actionid="XXXX" event="script" value="royalHelmetLever.lua"/>
You have to replace this XXXX with an actionid of your own choice. Now, create a file inside the folder /scripts and rename it to royalHelmetLever.lua. Now, inside it you must paste:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local royalHelmetPosition = {x = 1285, y = 1065, z = 9, stackpos = STACKPOS_TOP_MOVABLE_ITEM_OR_CREATURE}
	local royalHelmet = getThingFromPos(royalHelmetPosition)
	local toPos = {x = 1225, y = 1056, z = 10}
	
	if royalHelmet.itemid == 2498 then
		doRemoveItem(royalHelmet.uid)
		doTeleportThing(cid, toPos, TRUE)
		if item.itemid == 1945 then
			doTransformItem(item.uid, item.itemid+1)
		else
			doTransformItem(item.uid, item.itemid-1)
		end
		return true
	end
	return false
end

Now, go to your map and put the actionid "XXXX" on the lever.

Simple as it, you can make magic effect and stuff but I guess this is exactly what you asked for (remember: the action is only gonna work if the royal helmet is on the top of the stack. I could make a iteration to check where in the stack the royal helmet is, but I was too lazy to do it .-.)
 
dont i need to put in that the lever has the action id 61112 in LUA also? or am i wrong? cuz it dsnt works ^^ no error but i dont get teleported when i pull lever after put a rh at correct spot
 
Back
Top