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

Help {i Want Guild D00r}

andrewss

Nice Member
Joined
Jun 12, 2010
Messages
122
Reaction score
1
Location
E G Y P T
Guys i want guild door guild leader buy a guild door from shop and after buying he will get an item that when he will use it a door on a room in map editor will be to the Guild

INFORMATION:
1- TFS 0.3.6
2- client 8.54
3-item which will be used itemid 8985


Thx
 
Can it be in 2 scripts???
The first to construct the door and the second to make the door a guild door???

If it can, try with this:
1º In actions.xml this:
XML:
<action itemid="8985" event="script" value="consguilddoor.lua"/>
<action uniqueid="3355" event="script" value="guilddoor.lua"/>
2º In actions/scripts with name of consguilddoor.lua, the following:
Lua:
local item = 1209
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if fromPosition.x == CONTAINER_POSITION then
		doPlayerSendCancel(cid, "Put the construction kit on the floor first.")
		doSendMagicEffect(fromPosition, CONST_ME_BLOCKHIT)
	elseif getTileHouseInfo(fromPosition) == FALSE then
		doPlayerSendCancel(cid,"You may only construct this inside a house.")
		doSendMagicEffect(fromPosition, CONST_ME_BLOCKHIT)
	else
	 local transform = doTransformItem(item.uid, item)
	 doItemSetAttribute(transform, "aid", getPlayerGuildId(cid) + 3500)
	 doItemSetAttribute(transform, "uid", 3355)
	 doSendMagicEffect(toPosition, CONST_ME_MAGIC_RED)
	 doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have constructed a Guild Door.")
	end
	return TRUE
end
In local item = 1209, you need to change 1209 for the id of the door... xD

3º In actions/scripts with the name of guilddoor.lua, the following:
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerGuildId(cid) ~= (getItemAttribute(item.uid, "aid") -3500 then
return false
end
return true
end

And that's all.....
Now, for a guild door anywhere, you need to put action id = guild id + 3500, so only a member of the guild can enter....

Hope it works ^^

EDIT: Sorry, i dont know how to do spoilers here... :/
 
Last edited:
Yay I have been do it your guilddoor is not working for me i have been do it

guilddoor
Code:
-- Credits by Andrewss
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local GuildId = getPlayerGuildId(cid)
		if GuildId == 1 then
		local cidPosition = getCreaturePosition(cid)
			if cidPosition.x < toPosition.x then
				doTeleportThing(cid, {x=990,y=888,z=7}, TRUE)
								doCreatureSay(cid, "byebye Guildmember!", TALKTYPE_ORANGE_1)
		else
				doTeleportThing(cid, {x=toPosition.x-1,y=toPosition.y,z=toPosition.z}, TRUE)
								doCreatureSay(cid, "welcome Guildmember!", TALKTYPE_ORANGE_1)
			end
			return TRUE
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, but you're not in this guild.")
			return TRUE
	end
	return FALSE
end
thx
 
Back
Top