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

Scripting!!! HELP PLEASE

santin

Lost.Realm->Owner
Joined
Jun 2, 2007
Messages
52
Reaction score
0
Location
Brazil
Hello everybody...

I need some kind of script that teleports everybody on my screen..

Is that possible??

Thanks everybody!!
 
Here is a basic script I made fast:

- global.lua
Code:
-- Area iterator by Colandus @ OpenLua.com
function mapArea(fromPos, toPos)
	local x, y, z = fromPos.x, fromPos.y, fromPos.z
	return function()
		if (y < toPos.y) then
			y = y+1
		elseif (x < toPos.x) then
			y = fromPos.y
			x = x+1
		else
			x = fromPos.x
			y = fromPos.y
			z = z+1
		end
		if (x < toPos.x and y <= toPos.y or z < toPos.z) then
			return x, y, z
		end
	end
end

Script:
Code:
local pos = getPlayerPosition(cid)
local fromPos = {x=pos.x-7, y=pos.y-5, z=pos.z}
local toPos = {x=pos.x+7, y=pos.y+5, z=pos.z}
for x, y, z in mapArea(fromPos, toPos) do
	if (isCreature(getThingfromPos({x=x,y=y,z=z})) == 1) then
		doPlayerSendTextMessage(cid, 22, "Creature!")
	end
end
 
Last edited:
LIke this....

I wanna make kinda of a talkaction that teleport everybody on my screen...
Every player, every monster...

@Colandus..

how do i use it?

thanks
 
Just do as I say at the post above yours. And at the example script, it could be used like this:
Code:
local npos = {x=34,y=45,z=345} -- Where shall you get tped to?
function onUse(cid)
	local pos = getPlayerPosition(cid)
	local fromPos = {x=pos.x-7, y=pos.y-5, z=pos.z}
	local toPos = {x=pos.x+7, y=pos.y+5, z=pos.z}
	for x, y, z in mapArea(fromPos, toPos) do
		if (isCreature(getThingfromPos({x=x,y=y,z=z})) == 1) then
			doTeleportThing(getThingfromPos({x=x,y=y,z=z})), npos, 1)
		end
	end 
	return 1
end

Like that, an action script :P
 
Last edited:
Well, this script does the following:
- When you use a certain item, all creatures in your screen will be teleported to "npos".
 
Back
Top