• 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 Actions Script Help

I r New

New Member
Joined
Feb 1, 2008
Messages
137
Reaction score
1
I'm trying to make it so I use a pick on a blood stain (ID 1901) and it teleports you to this position.
The Blood Stain has the action ID 1000 in the map editor - "16:22 You see a bloodspot.
ItemID: [1901], ActionID: [1000]."
2553 is a pick.
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local pos = { x =1048 , y = 1003 , z = 7 }
if itemEx.actionid == 2553 then
	doTeleportThing(cid, pos)
		end
	return true
end
The XML is
XML:
	<action actionid="1000" event="script" value="quests/use_pick.lua"/>

and it's not working at all, no errors or anything
Can anyone help?
 
merge it with pick.lua
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if((itemEx.uid <= 65535 or itemEx.actionid > 0) and isInArray({354, 355}, itemEx.itemid)) then
		doTransformItem(itemEx.uid, 392)
		doDecayItem(itemEx.uid)
		doSendMagicEffect(toPosition, CONST_ME_POFF)
		return true
	end

	if(itemEx.itemid == 7200) then
		doTransformItem(itemEx.uid, 7236)
		doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
		return true
	end

[B][COLOR="red"]	if(itemEx.actionid == 1000) then
		doTeleportThing(cid, {x=1048, y=1003, z=7})
		doSendMagicEffect({x=1048, y=1003, z=7}, CONST_ME_TELEPORT)
		return true
	end[/COLOR][/B]

	return false
end
 
wow, why did I think of doing that >_<
I've just done it like this before and it worked ;c

haha thanks C:

Edit: ...That's not working ;s

Edit 2: FIXED IT CCCCCCCCC: I accidently put an extra 'end' loooooooooooooooooool
 
Last edited:
Back
Top