• 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][8.60][door acces for player from 9 to 15 lvl]

SonGoqu

New Member
Joined
Nov 27, 2008
Messages
64
Reaction score
0
Hello,
I have a tfs 0.3.6 and I need a script for a door that allows players with lvl from 9 to 15 to go through.

can someone help me?

Thx
 
Last edited:
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == ID_OF_CLOSED_DOOR then
		local k = getPlayerLevel(cid)
		if k >= 9 and k <= 15 then
			doTransformItem(item.uid, item.itemid + 1)
			doTeleportThing(cid, toPosition, true)
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Only the worthy may pass.')
		end
		return true
	end
end
 
Last edited:
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local k = getPlayerLevel(cid)
	if k >= 9 and k <= 15 then
		doTransformItem(item.uid, item.itemid + 1)
		doTeleportThing(cid, toPosition, true)
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Only the worthy may pass.')
	end
	return true
end

Will it work if he wants to close those doors? I doubt, cause it has unique id, so you have to handle it in your script : P
 
I have one more question, can You 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, item.itemid + 1)
		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
 
Last edited:
Back
Top