UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Moving Model in order Problem

broken avatar :(
Created 6 years ago
by stressedpitbull
0 Members and 1 Guest are viewing this topic.
770 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 9 June 2013
Last active: 6 years ago
Posts
1
Respect
Forum Rank
Fresh Corpse
Primary Group
Member
×
stressedpitbull's Contact & Social Links

Ive Been trying to move a row of bottles up and down with the bottles next to each other going in opposite directions, I made an array to give me 8 numbers that repeat 0,1 with the for loop algorithm below,
 then foreach bottle I have, I check if the bottles direction which is either 0 or 1, then the bottle moves a ceratin way, how ever im getting a strange pattern of something like 01001101 instead of 01010101. ive manually changed the arrays to 01010101 and it makes the same pattern. Any Help is welcome, Thanks!

Code:

Code Snippet
Plaintext
function init_move_bottle()

{

directions = ;

s = 0;

bottles_m = GetEntArray("bottle_m","targetname");

index = 0;





for (i=0;i<8;i++)

{

if (s == 0)

{

directions

= 0;

s = 1;

}



else if (s == 1)

{

directions

= 1;

s = 0;

}

}





foreach (bottle_m in bottles_m)

{

direction = directions[index];



bottle_m thread move_bottle(direction);

index++;

}

}





function move_bottle(direction)

{

bottle_m_t = GetEnt(self.target,"targetname");

bottle_m_t EnableLinkTo();

bottle_m_t LinkTo(self);





if (direction == 0)

{

while (1)

{

self MoveZ(30,3);

wait 4;

self MoveZ(-30,3);

wait 4;

}

}



if (direction == 1)

{

while (1)

{

self MoveZ(-30,3);

wait 4;

self MoveZ(30,3);

wait 4;

}

}



}
Last Edit: February 13, 2018, 04:48:52 am by Lukkie1998

 
Loading ...