#1

hello
how can i make a object moving up and down randomly without anyones interference.?
Reply
#2

could u clearify more
Reply
#3

the object will move up and down with any commands or without going near it.
it moves randomly.
I just need the example code please...
Reply
#4

Okay but first. Make a CreateObject code with the correct model id , coordinates. I'll move it properly without any command. Once i've tested it. Ill paste it over here.
Reply
#5

I use timer to make the object move by itself, just see at my filterscript
Reply
#6

here is the coords

Quote:

CreateObject(3865, -2712.88, 583.54, 16.30, 0.00, 0.00, 270.01); //down

CreateObject(3865, -2712.88, 583.54, 34.95, 0.00, 0.00, 270.01);//up

Reply
#7

TESTED

pawn Код:
//At top
new pipe;//To store Object ID
new loc; // To store current location of object

public OnGameModeInit()
{
//And all your codes...
    loc = 0; //Currently it is down
    pipe = CreateObject(3865, -2712.88, 583.54, 16.30, 0.00, 0.00, 270.01); //down
    new time = MoveObject(pipe,-2712.88, 583.54, 34.95,2); //Will move it up
    SetTimer("MovePipe",time,true);//time is time it takes to go up/down
    return 1;
}

forward MovePipe();
public MovePipe()
{
    switch(loc)
    {
        case 0:
        {
            MoveObject(pipe, -2712.88, 583.54, 16.30,2);
            loc = 1;
        }
        case 1:
        {   MoveObject(pipe,-2712.88, 583.54, 34.95,2);
            loc = 0;
        }
    }
    return 1;
}
//To make it move up/down
Reply
#8

Its is working
But how can i make if the object reached at the top or down then it should wait 5 seconds to go up/down again?
Reply
#9

pawn Код:
SetTimer("MovePipe",time + 5000,true);
Reply
#10

Thank you very much bro )) i must give you rep otherwise i'm an idiot
+rep
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)