Jump to content

Timer Problem, need help.


DonPro

Recommended Posts

Hi, this is a timer that have been set, but they object start go faster, and sometimes slower. and i have tryed everything to make it go in the same speed but it does not work at all. could you help me and show me whats wrong with it?

local moveTable = { 
--{time, x, y, z, rotX, rotY, rotZ}, 
{10000, 2896.19, -2397.39, 3.70}, 
{80000, 2896.19, -2762.60, 3.70}, 
{35000, 2854, -2874.60, 3.70}, 
{125000, 1162.09, -2874.60, 3.70}, 
{210000, 880.70, -2146.5, 3.70}, 
{270000, 880.70, -1884.09, 3.70}, 
} 
  
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 
        outputChatBox(time) 
        setTimer(moveObject,time,1,object1, unpack(v)) 
        end 
    end 
end 
  
function moveGate(playerSource, cmd) 
        move() 
end 
addCommandHandler("gostart", moveGate) 

Link to comment
Simply use the same timer.

could you show me what you mean? i was looking at Wiki, but i didnt understand that lol

change the timer in your "moveTable".

So if i set it like this

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

you mean it will go same speed all the time? :)

Link to comment
Yeah he does.

According to the format, yes.

Well im sorry, but it does not. thats what im talking about, even if i put 10000millisecond in every it still go faster and slower when it wants, there is something bugged in the script somewhere that i dont understand. thats my problem, so yesterday i tryed to adjust the millisecond (start with 10000 and second 80000 then it goes the nearly the same speed somehow.)

Link to comment
Yeah he does.

According to the format, yes.

Its "Time" not "Speed"

It wont go with the same speed unless the space between every 2 points is the same

because for example 100km in 10 seconds will go faster than 1000km in 10 seconds

Thats makes sence, now i understand thanks! now i have to work a bit on it and adjust it :D thanks bro :D

Link to comment

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...