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

9.1 Teleport Summon

lutek14

New Member
Joined
Jan 30, 2009
Messages
13
Reaction score
1
Hello
I would like this function teleport summon but it doesnt work.
Im using tfs 0.2.11pl2

function onSay(cid, words, param)
local pid = getCreatureSummons(cid)
local summonPos, playerPos = getThingPos(pid), getThingPos(cid)
local thisPlayer, thisSummon = {x = summonPos.x + 5, y = summonsPos.y, z = summonPos.z}, {x = playerPos.x - 5, y = playerPos.y, z = playerPos.z}
if getDistanceBetween(thisPlayer, thisSummon) >= 5 then
doTeleportThing(pid, playerPos, true)
end
return true
end


Please help!
 
Try this:

Lua:
function onSay(cid, words, param)
local pid = getCreatureSummons(cid)
local summonPos, playerPos = getThingPos(pid), getPlayerPosition(cid)
local Player, Summon = {x = summonPos.x + 5, y = summonsPos.y, z = summonPos.z}, {x = playerPos.x - 5, y = playerPos.y, z = playerPos.z}
local summons = getCreatureSummons(cid)
	if(table.maxn(summons) >= 1) and getDistanceBetween(Player, Summon) >= 5 then
	for _, pid in ipairs(summons) do
		doTeleportThing(cid, playerPos)
end
end
return true
end
 
Back
Top