Dileck
New Member
- Joined
- Sep 20, 2008
- Messages
- 93
- Reaction score
- 2
For some reason this spells works fine when used on my god account, but if i use it on a normal player it crashes the client, the spell is basically a teleport into the direction you are looking without going through walls or blocking objects
i'm using the latest tfs 1.2 master rev
Anyone got any explanation as to why this happens?
i'm using the latest tfs 1.2 master rev
Code:
function onCastSpell(cid, var)
local position = Position(cid:getPosition())
local direction = getPlayerLookDir(cid)
local newpos = Position(cid:getPosition())
if direction == NORTH then
newpos.y = newpos.y -5
while position.y ~= newpos.y do
position.y = position.y - 1
if isSightClear(cid:getPosition(), position, true) == true and isWalkable(position) then
local field = Item(doCreateItem(1491, 1, cid:getPosition()))
field:decay()
doTeleportThing(cid, position, true)
else
break
end
end
Anyone got any explanation as to why this happens?
Last edited: