Jump to content

Attach Object to (MOVE OBJECT TOGHETER)


DonPro

Recommended Posts

Posted
local object1 = createObject(9585, -2040.5999755859, 1442, 7, 0, 0, 0) 
local obj1X, obj1Y, obj1Z = getElementPosition(object1) 
local object2 = createObject(9586, obj1X-2.2998046875, obj1Y, obj1Z+10.1, 0, 0, 0) 
local object3 = createObject(9584, obj1X+20.400390625, obj1Y, obj1Z+17, 0, 0, 0) 
local object4 = createObject(9698, obj1X+31.9, obj1Y-1.17, obj1Z+19.9, 0, 0, 0) 
attachElements(object2,object1,-2.2998046875,0,10.1) -- attach object2 to object1 
attachElements(object3,object1,20.400390625,0,17) -- attach object2 to object1 
attachElements(object4,object1,31.9,-1.17,19.9) -- attach object2 to object1 
  
local moveTable = { 
--{time, x, y, z, rotX, rotY, rotZ}, 
{60000, -2040.59, 1598.5, 7, 0, 0, 0}, 
{60000, -3111.19, 1764.19, 7, 0, 0, 180}, 
{60000, -3204.80, -2873.5, 7, 0, 0, 270}, 
} 
  
function move() 
    for k,v in ipairs(moveTable) do 
        if k == 1 then 
        moveObject(object1, unpack(v)) 
        else 
        local time = 0 
            if k ~= 2 then 
                for i=1,k-1 do 
                time = time + moveTable[i][1] 
                end 
            else 
                time = moveTable[1][1] 
            end 
        setTimer(moveObject,time,1,object1, unpack(v)) 
        end 
    end 
end 
  
function moveGate(playerSource, cmd) 
    if cmd == "gostart" then 
        if isAclGroup(playerSource,"Maritime") then 
        move() 
        end 
    end 
end 
addCommandHandler("gostart", moveGate) 

Hi, i wonder why the ship speed up for each cordinat/check point it hit, then the object speed up and sometimes speed down i dont understand o.O i tought the speed should go down when i raise the value on the SPEED :P i hope you can help me with that, its pretty anoying, and i tryed to lower, and raise the speed but nothing helps. :P

Posted

{time, x, y, z, rotX, rotY, rotZ}

time = the time that the ship should move from position to the next position

when you put 2 points that are so far with 60000 milliseconds the ship gonna move with a diffrent speed if the 2 points was close with 60000 milliseconds

Posted
{time, x, y, z, rotX, rotY, rotZ}

time = the time that the ship should move from position to the next position

when you put 2 points that are so far with 60000 milliseconds the ship gonna move with a diffrent speed if the 2 points was close with 60000 milliseconds

Ahh okey, i didnt understand much :S but this is what i got now, this is just a test speed i made to test it fast on 5000time.

local moveTable = { 
--{time, x, y, z, rotX, rotY, rotZ}, 
{5000, 2896.19, -2397.39, 3.70, 0, 0, 0}, 
{5000, 2896.19, -2762.60, 3.70, 0, 0, -90}, 
{5000, 2854, -2874.60, 3.70, 0, 0, 90}, 
{-5000, 1162.09, -2874.60, 3.70, 0, 0, -90}, 
{45000, 880.70, -2146.5, 3.70, 0, 0, 90}, 
{55000, 880.70, -1884.09, 3.70, 0, 0, 90}, 
} 

Posted
time must be a positive number

what do you mean?

the minimum is 50 milliseconds.

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted
time must be a positive number

what do you mean?

the minimum is 50 milliseconds.

so the ship have to go as fast as 50 millisecound? pleas show me in script what you mean :S i dont understand what ya'll talking about :/

Posted

so the ship have to go as fast as 50 millisecound? pleas show me in script what you mean :S i dont understand what ya'll talking about :/

Check the wiki page before u start asking all what you need is here : SetTimer

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted

so the ship have to go as fast as 50 millisecound? pleas show me in script what you mean :S i dont understand what ya'll talking about :/

Check the wiki page before u start asking all what you need is here : SetTimer

Thanks! i will check this out, i just started scripting just trying to learn :)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...