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

[8.54] Summons problem

Erexo

Kage
Premium User
Joined
Mar 27, 2010
Messages
741
Solutions
5
Reaction score
194
Location
Pr0land
GitHub
Erexo
Hello,
i need help with summons...

I need,
when someone go upstairs/downstairs, summon teleport to him.

I dont know what should i do :(


Thanks,
Erexo.
 
-- Summons
maxPlayerSummons = 2
teleportAllSummons = true
teleportPlayerSummons = true

I have that, and still not tp :F
 
Use this code:
Lua:
Lua Code:
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
                        if not getTileInfo(getThingPos(t)).protection then
			     doTeleportThing(summ[1], getThingPos(t))
			     doSendMagicEffect(getThingPos(t), 12)
                        end
		end
	end
	return true
end
 
Back
Top