• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

[Pokemon] Summon teleport

KylerXX

Active Member
Joined
Jun 24, 2010
Messages
439
Reaction score
30
Well, I made this script little time ago and seen that pokemon servers are progressing a lot I decided post it.

Script work:
When your summon (pokemon) is far from you or fallen down a hole teleports to your position.

Go to globalevents/scripts/ create a LUA file called teleport.lua and add this:
Lua:
function onThink(interval, lastExecution, thinkInterval)
local tabla = {}
local maxDistance = 10
	for _, pid in ipairs(getPlayersOnline()) do
	local summons = getCreatureSummons(pid)
		if #summons > 0 then	
			table.insert(tabla, pid)
		end
	end
	for _, t in ipairs(tabla) do
	local summ = getCreatureSummons(t)
		if getThingPos(t).z ~= getThingPos(summ[1]).z or getDistanceBetween(getThingPos(t), getThingPos(summ[1])) > maxDistance then
			doTeleportThing(summ[1], getThingPos(t))
			doSendMagicEffect(getThingPos(t), 12)
		end
	end
	return true
end

Now you go to globalevents.xml and add this:
XML:
<globalevent name="teleport" interval="1" event="script" value="teleport.lua"/>


:p
 
nice, ty, its usefull for who is making poke server rep++
 
Last edited:
Ty I Have Max 6 Pokes :) and some others like teleport and that D:!
 
Back
Top