• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Is it possible to create a vocation that "tp" when hitting someone

leokart7

New Member
Joined
Mar 19, 2015
Messages
46
Reaction score
0
So like a few years ago I played tibia a lot. I remember playing an OtServer that had a vocation named "Ninja", and this guy whenever he hitted someone with an attack he teleported around the guy.

Meaning:
SUPPOSE X IS MONSTER AND Y IS NINJA

1st attack:
O O O
O X O
O Y O

2nd attack:

O O O
O X Y
O O O

3rd attack

Y O O
O X O
O O O

I do know it's possible but I have no idea how to do so. Or instead of making a vocation a weapon or something. THANK YOU! :)
 
Ok so since when I changed it for the ID 9 when I logged it switched to ID 4, which is the kngith, I changed it for the Knight. so the id is now 4.

So in the creaturescript.xml:
Code:
    <event type="combat" name="Ninja" event="script" value="ninja.lua"/>

in the ninja.lua:
Code:
function onCombat(cid, target)
     if getPlayerVocation(cid) == 4 and getCreatureTarget(cid) == target then
         if not exhaustion.check(cid, 38475) then
             doTeleportThing(cid, getClosestFreeTile(cid, getThingPosition(target)), false)
             exhaustion.set(cid, 38475, 1)
         end
     end
     return true
end

in the login.lua
Code:
    registerCreatureEvent(cid, "Ninja")
[/CODE]
 
in the console it doesn't show any errors.. I'll try the textmessage in the fuction to see if its loaded properly. good idea @Limos ill keep you updated if it does
 
@Limos I tried putting the textmessage function but I started some type of error. but I retried doing everything in a whole new clean ot server and it wouldn't work as well :/
 
Back
Top