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

[tfs 0.3.6][from lvl to lvl doors][item+1 problem]

SonGoqu

New Member
Joined
Nov 27, 2008
Messages
64
Reaction score
0
Can someone repair this script

Code:
[COLOR="darkgreen"]function onUse(cid, item, fromPosition, itemEx, toPosition)
	local k = getPlayerLevel(cid)
	if k >= 1 and k <= 13 then
		doTransformItem(item.uid,[COLOR="darkred"] item.itemid + 1[/COLOR])
		doTeleportThing(cid, toPosition, true)
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Players from lvl 1 to lvl 13 can pass this door.')
	end
	return true
end[/COLOR]

All works, but when someone stay on this door and "klick" to close then the door don't close but it will be created a next item (.itemid + 1). How to repair this?


wxijc1oo0iubglqkuqo.png
kexnnp4gptcpow04802e.png
bk17il1dt8ez18chy386.png
tc31e94anbys9s5jl827.png
 
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local k = getPlayerLevel(cid)
	if k >= 1 and k <= 13 then
		doTransformItem(item.uid, CLOSED DOOR ID)
		doTeleportThing(cid, toPosition, true)
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Players from lvl 1 to lvl 13 can pass this door.')
	end
	return true
end
edit this part: doTransformItem(item.uid, CLOSED DOOR ID)
to your closed door id like:
doTransformItem(item.uid, 1234)
 
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local k = getPlayerLevel(cid)
	if k >= 1 and k <= 13 then
		doTransformItem(item.uid, CLOSED DOOR ID)
		doTeleportThing(cid, toPosition, true)
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Players from lvl 1 to lvl 13 can pass this door.')
	end
	return true
end
edit this part: doTransformItem(item.uid, CLOSED DOOR ID)
to your closed door id like:
doTransformItem(item.uid, 1234)

Thank You it works but the door/fence don't change, the person walk thorough the closed door:

78flz2nttq6scvvuns44.png
 
Back
Top