• 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 function onStandIn ?

ligus

New Member
Joined
Apr 26, 2010
Messages
253
Reaction score
0
Hey, I have problem with script.
Script should work like that: if player STAND on special tile and items are on another tile then it should create itemID 2342.

I have this script
Lua:
local pos = {x=33198, y=32876, z=11}
function onStepIn(cid, item, position)
	if isPlayer(cid) == TRUE then
		for i = 2335, 2341 do
			if getTileItemById(pos, i).uid < 1 then return end
		end
		for i = 2335, 2341 do
			doRemoveItem(getTileItemById(pos, i).uid)
		end
		doCreateItem(2342, 1, pos)
		doSendMagicEffect(pos, CONST_ME_FIREAREA)
		setPlayerStorageValue(cid,65498,1)
	end
end

This script works but at first I must put items and at second I must STEP on special tile.

just look 3:20
YouTube - Ashmunrah

script should work like: i am on special tile, i put items and item is created when i STAND on tile..
how can I do that?
 
scriptname.lua
Code:
function onAddItem(moveitem, tileitem, position, cid)
	[B][COLOR="Red"]local iTypes = {2335, 2336, 2337, 2338, 2339, 2340, 2341}[/COLOR][/B]
	if isPlayer(cid) then
		for i = 0, 6 do
			if getTileItemById(position, iTypes[i]).uid < i then
				break
			end
			doRemoveItem(getTileItemById(position, iTypes[i]).uid)
		end
		doCreateItem(2342, 1, position)
		doSendMagicEffect(position, CONST_ME_FIREAREA)
		setPlayerStorageValue(cid, 65498, 1)
	end
	return true
end
movements.xml
Code:
<movevent type="AddItem" tileitem="6" itemid="424" event="script" value="scriptname.lua"/>
now ull need to throw the items colored in the lua script in a item id with 424.
now try and say it doesnt work, cuz u piss me off

Well it works but with 3bugs :(
First - if player put only one item (should put 6) then item 2342 is created
Second - item which is put by player isn't removed
Code:
Description:
(luaDoRemoveItem) Item not found
Third thing - player doesn't have to stand in front of this "altar" YouTube - clip0002.avi

thanks anyway
 
Back
Top