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

[Movement] only party team can enter

Knight God

Member
Joined
Oct 19, 2008
Messages
1,180
Reaction score
21
As the title says, I wonder if there is a way for teams only can happen if you are in a party and have more of a certain number of members including:

If you have 5 members in your party, you can spend.
But if you not have more than 5 members in your party, you can not pass.

if you can help me I thank you in advance and thank you very much
Solved by me :D
 
Last edited:
XML:
	<movevent type="StepIn" actionid="5001" event="script" value="script.lua"/>

Lua:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	local limitMembers = 5
 
	if isPlayer(cid) then
		if getPlayerParty(cid) ~= nil then
			if #getPartyMembers(cid) >= limitMembers then
				return true
			end
 
			doPlayerSendCancel(cid, 'You are in party without enough members: ' .. limitMembers .. '.')
			return false
		end
 
		doPlayerSendCancel(cid, 'You are not in party.')
	end
	return false
end
 
Last edited:
PHP:
-- Made By VirrageS and Edited by Knight God --

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)

	local limitMembers = 2

	if isPlayer(cid) then
		if getPlayerParty(cid) ~= nil then
			local pos, membersList = getCreaturePosition(cid), getPartyMembers(cid)
			if(membersList == nil or type(membersList) ~= 'table' or table.maxn(membersList) >= 3) then
				return true
			end
 
			doPlayerSendCancel(cid, "You are in party without enough members: [" ..limitMembers.."]")
			doTeleportThing(cid, fromPosition, false)
			return false
		end
 	doPlayerSendCancel(cid, "You are not in party")
	doTeleportThing(cid, fromPosition, false)
	end
	return false
end


Sorry double post :/, here is the script working in tfs 0.4 and 0.3.6
Thanks VirrageS :)
Good luck
 
Back
Top