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

random temple

Please explain this more, do you want them to use a lever and go to a random temple?
 
Man i need script like this:
function onLogin(cid)
local temple = {
{x=,y=,z=},
{x=,z=,z=},
{x=,y=,z=}
}
doTeleportThing(cid, swiatynie[math.random(1, #temple)])
return true
end
But i want to add also exhaustion for relog (3 sec),and if players are more than 50 on servers than active are 5 temples if people is less than 50 people (1 temple is actived)
can u make this please ;)
 
Last edited:
Lua:
local temple = {
	{x=,y=,z=},
	{x=,z=,z=},
	{x=,z=,z=},
	{x=,z=,z=},
	{x=,y=,z=}
}

local condition = createConditionObject(CONDITION_INFIGHT)
setConditionParam(condition, CONDITION_PARAM_TICKS, 3000)

function onLogin(cid)
	doAddCondition(cid, condition)
	doTeleportThing(cid, temple[math.random(getWorldCreatures(0) >= 50 and #temple or 1)])
	return true
end
If there are less than 50 on, the first position in table will be chosen :p
 
edit the old script:
Code:
local temple = {
	{x=,y=,z=},
	{x=,z=,z=},
	{x=,z=,z=},
	{x=,z=,z=},
	{x=,y=,z=}
}
 
local condition = createConditionObject(CONDITION_INFIGHT)
setConditionParam(condition, CONDITION_PARAM_TICKS, 3000)
[B][COLOR="red"]setConditionParam(condition, CONDITION_PARAM_SUBID, 1)[/COLOR][/B]
 
function onLogin(cid)
	doAddCondition(cid, condition)
	doTeleportThing(cid, temple[math.random(getWorldCreatures(0) >= 50 and #temple or 1)])
	return true
end
and create new script (register in creaturescripts.xml too)
Lua:
function onLogout(cid)
	if hasCondition(cid, CONDITION_INFIGHT, 1) then
		doPlayerSendCancel(cid, 'Sorry, you can\'t relog for 3 seconds.')
		return false
	end
	return true
end
won't work if battle condition is checked before executing onLogout creaturescript :p
 
Back
Top