0


I downloaded script CS2DTibia - RPG in: [url]http://www.unrealsoftware.de/forum_posts.php?post=176932&start=0/url and don't know how to make the monster use teleport next to who it want to kill.

Example:

http://img140.imageshack.us/img140/9104/40011462.png

I have a script teleport for monster but for running not attacking people

{
    name = 'Abra', health = 100, image = 'gfx/weiwen/pokemon/63.png', scalex = 2, scaley = 2, 
    atk = 0.6, def = 1.0, spd = 5, atkspd = 10, x = 0, y = 0, ang = 0, imgang = 0, spawnchance = 20, runat = 100, spawn1 = {0, 0}, spawn2 = {150, 150}, 
    exp = 10, money = 100, loot = {{chance = 5000, id = 105}},
    spc = {2500, function(self) 
        radiusmsg("Abra uses teleport!", self.x, self.y)
        parse("effect \"colorsmoke\" " .. self.x .. " " .. self.y .. " 5 5 255 255 255")
        local dir = math.random(math.pi*2)
        if self:move(dir, 40) or self:move(dir, -40) then
            parse("effect \"colorsmoke\" " .. self.x .. " " .. self.y .. " 5 5 255 255 255")
        end
    end},

},

flag offensive
asked 2010-05-19 03:38:09.541758
1
add comment
1 Answers:
0


Maybe you should use math.sin and math.cos? I don't know what functions does tibiarpg script give you but you should replace self:move and make something like this:

self.x, self.y = math.cos(dir)*40, math.sin(dir)*40
permanent link | flag offensive
answered 2010-05-22 12:13:38.709494
21
add comment
Your answer:
You are now not logged in but you can answer first and then login
toggle preview



Tags:

× 2
× 1

Asked: 2 years ago

Seen: 1,754 times

Last updated: 1 year, 12 months ago

Made with Django.