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

MoveEvent Teleport Online!

Printer

if Printer then print("LUA") end
Senator
Premium User
Joined
Dec 27, 2009
Messages
5,782
Solutions
31
Reaction score
2,285
Location
Sweden?
Hello,

Here is a script Requested By: Ghazer, you enter a teleport depending on how many players you have configure it with.

Pretty simple, but may come handy!

At Movements/movements.xml add this line:
XML:
<movevent type="StepIn" actionid="1337" event="script" value="onlinetp.lua"/>

Now at Movements/scripts create new lua and name it "onlinetp" and paste this code below:
Lua:
local Cyko = {
	Pos = {x = 1000, y = 1000, z = 7}, --Where they get teleported
	Count = 30, --How many players have to be online, to enter the teleport
}

function onStepIn(cid, item, position, fromPos, fromPosition)
	local Online = getWorldCreatures()
        if isPlayer(cid) then
	if Online < Cyko.Count then
		doPlayerSendTextMessage(cid,27, "Sorry, but its only "..Online.." Players Online. Have to be "..Cyko.Count.."+ Players online, to enter this teleport.")
		doTeleportThing(cid, fromPosition, true)
		doSendMagicEffect(fromPos, CONST_ME_TELEPORT) 
		return true
	elseif Online >= Cyko.Count then
		doTeleportThing(cid, Cyko.Pos) 
		doSendMagicEffect(Cyko.Pos, CONST_ME_TELEPORT) 
		doSendMagicEffect(posistion, CONST_ME_TELEPORT) 
		end
        end
	return true
end

Enjoy!
 
Last edited:
Lua:
local Cyko = {
	Pos = {x = 1000, y = 1000, z = 7}, --Where they get teleported
	Count = 30, --How many players have to be online, to enter the teleport
}
 
function onStepIn(cid, item, position, fromPos, fromPosition)
	local Online = getWorldCreatures()
        if isPlayer(cid) then
	if Online < Cyko.Count then
		doPlayerSendTextMessage(cid,27, "Sorry, but its only "..Online.." Players Online. Have to be "..Cyko.Count.."+ Players online, to enter this teleport.")
		doTeleportThing(cid, fromPosition, true)
		doSendMagicEffect(fromPos, CONST_ME_TELEPORT) 
		return true
	elseif Online >= Cyko.Count then
		doTeleportThing(cid, Cyko.Pos) 
		doSendMagicEffect(Cyko.Pos, CONST_ME_TELEPORT) 
		doSendMagicEffect(position, CONST_ME_TELEPORT) 
		end
        end
	return true
end

Just modified that part:

Lua:
elseif Online == Cyko.Count then
	doTeleportThing(cid, Cyko.Pos) 
	doSendMagicEffect(Cyko.Pos, CONST_ME_TELEPORT) 
	doSendMagicEffect(position, CONST_ME_TELEPORT) 
elseif Online > Cyko.Count then
	doTeleportThing(cid, Cyko.Pos)
	doSendMagicEffect(Cyko.Pos, CONST_ME_TELEPORT) 
	doSendMagicEffect(position, CONST_ME_TELEPORT)
 
Lua:
local Cyko = {
	Pos = {x = 1000, y = 1000, z = 7}, --Where they get teleported
	Count = 30, --How many players have to be online, to enter the teleport
}
 
function onStepIn(cid, item, position, fromPos, fromPosition)
	local Online = getWorldCreatures()
        if isPlayer(cid) then
	if Online < Cyko.Count then
		doPlayerSendTextMessage(cid,27, "Sorry, but its only "..Online.." Players Online. Have to be "..Cyko.Count.."+ Players online, to enter this teleport.")
		doTeleportThing(cid, fromPosition, true)
		doSendMagicEffect(fromPos, CONST_ME_TELEPORT) 
		return true
	elseif Online >= Cyko.Count then
		doTeleportThing(cid, Cyko.Pos) 
		doSendMagicEffect(Cyko.Pos, CONST_ME_TELEPORT) 
		doSendMagicEffect(position, CONST_ME_TELEPORT) 
		end
        end
	return true
end

Just modified that part:

Lua:
elseif Online == Cyko.Count then
	doTeleportThing(cid, Cyko.Pos) 
	doSendMagicEffect(Cyko.Pos, CONST_ME_TELEPORT) 
	doSendMagicEffect(position, CONST_ME_TELEPORT) 
elseif Online > Cyko.Count then
	doTeleportThing(cid, Cyko.Pos)
	doSendMagicEffect(Cyko.Pos, CONST_ME_TELEPORT) 
	doSendMagicEffect(position, CONST_ME_TELEPORT)

I never thougt about that, thanks for reminding me :)
 
Hello,

Here is a script Requested By: Ghazer, you enter a teleport depending on how many players you have configure it with.

Pretty simple, but may come handy!

At Movements/movements.xml add this line:
XML:
<movevent type="StepIn" actionid="1337" event="script" value="onlinetp.lua"/>

Now at Movements/scripts create new lua and name it "onlinetp" and paste this code below:
Lua:
local Cyko = {
	Pos = {x = 1000, y = 1000, z = 7}, --Where they get teleported
	Count = 30, --How many players have to be online, to enter the teleport
}

function onStepIn(cid, item, position, fromPos, fromPosition)
	local Online = getWorldCreatures()
        if isPlayer(cid) then
	if Online < Cyko.Count then
		doPlayerSendTextMessage(cid,27, "Sorry, but its only "..Online.." Players Online. Have to be "..Cyko.Count.."+ Players online, to enter this teleport.")
		doTeleportThing(cid, fromPosition, true)
		doSendMagicEffect(fromPos, CONST_ME_TELEPORT) 
		return true
	elseif Online >= Cyko.Count then
		doTeleportThing(cid, Cyko.Pos) 
		doSendMagicEffect(Cyko.Pos, CONST_ME_TELEPORT) 
		doSendMagicEffect(position, CONST_ME_TELEPORT) 
		end
        end
	return true
end

Enjoy!

What's that position at the end ?? Did you actually test this out before releasing it ??
 
Yes it is, but posistion, its showing the effect when i enter the tp and effect on the dest.
 
Last edited:
thou hath chosen a path of cancer, my little apprentice
 
You shall remove the kebab then!
 
Doesn't getWorldCreatures(type) returns ALL the creatures including NPCs and/or monsters or did I miss something?
 
Back
Top