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

Solved spell crashes client when used by normal account

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

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:
apparently it was because of the spell id being to high, i had it at 1001 and changed it to 10 and it works now.


Can someone explain spells id to me? whats their function
 
Last edited:
Spell ID is the image that is generated after using the spell (to show the cooldown), so you must use spellids that work. If you use 1001 for example , it'll try and create an image that doesn't exist and crash.

Reason it didn't happen for your God is God's dont get cooldowns ^_^
 
Back
Top