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

Spell How to make teleport spell

Yskoff

New Member
Joined
Jan 5, 2013
Messages
1
Reaction score
0
Hello guys i am the new on this forum and i just looking for (spell) teleport by 2 square of front player can u guys help me with that?;p Thanks very much
 
that would be a talkaction
and why not just use /a 2 if your talking about a command for a god/gm?
 
Lua:
function onCastSpell(cid, var)

function isWalkable(pos)
	pos.stackpos = 0
	local tile = getThingfromPos(pos, false)
	if tile ~= 0 and not hasProperty(tile.uid, CONST_PROP_BLOCKSOLID) and not isCreature(getTopCreature(pos).uid) then
		return true
	end
end

	local pos = getClosestFreeTile(cid, getPosByDir(getCreaturePosition(cid), getCreatureLookDirection(cid), 2), false, false)
	if(not pos or isInArray({pos.x, pos.y}, 0)) or (getTilePzInfo(pos)) or not isWalkable(pos) then
		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) 
		doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
		return false
	end

	local cpos = getCreaturePosition(cid)
	if(doTeleportThing(cid, pos, true)) then
		doSendMagicEffect(cpos, CONST_ME_POFF)
		doSendMagicEffect(pos, 27)
	end

	return true
end

Next time in Requests
 
Back
Top