Post: GSC Loop Command Help!
08-28-2016, 07:04 AM #1
(adsbygoogle = window.adsbygoogle || []).push({}); I am trying to loop a command and don't know exactly what to do!*
I also would like the loop to go though the command 3 times and at a speed of 7 seconds every loop!
If that is even possible than please let me know!

I'm working on a gamemode that should be awesome for everyone, so PLS REPLY

Thanks For Reading,

Thomas
(adsbygoogle = window.adsbygoogle || []).push({});
08-28-2016, 07:34 AM #2
JustFuSiOn
Are you high?
Originally posted by Thomas
I am trying to loop a command and don't know exactly what to do!*
I also would like the loop to go though the command 3 times and at a speed of 7 seconds every loop!
If that is even possible than please let me know!

I'm working on a gamemode that should be awesome for everyone, so PLS REPLY

Thanks For Reading,

Thomas


for(i = 3;i < 0;i--)
{
//Insert loop contents here
wait 7;
}
08-28-2016, 07:41 AM #3
gsc studio says there is a syntax error when i use that!
08-28-2016, 02:20 PM #4
TotalModzHD
Bounty hunter
Originally posted by Thomas
Santax error when i use it!


Screenshot that code in your project and post it here.
08-28-2016, 02:35 PM #5
I'm now using this code:
myloop()
{
self.number = 3;
for(;Winky Winky
{
self thread setup();
self.number++;
wait 10;
}
}

setup()
{
color = randomIntRange(1, 4);
if(color == 1)
{
self.color = "1";
if(getDvar("mapname") == "mp_dockside")
{
iprintlnbold("Stand On The Color Orange");
wait 3;
level thread DeleteByModel("p6_dockside_container_lrg_white");
level thread DeleteByModel("p6_dockside_container_lrg_blue");
level thread DeleteByModel("p6_dockside_container_lrg_red");
wait 3;
WhiteContainer((-100, 0, 500), (0, 90, 0));
WhiteContainer((250, 0, 500), (0, 90, 0));
WhiteContainer((600, 0, 500), (0, 90, 0));
BlueContainer((-100, -140, 500), (0, 90, 0));
BlueContainer((250, -140, 500), (0, 90, 0));
BlueContainer((600, -140, 500), (0, 90, 0));
RedContainer((-100, -280, 500), (0, 90, 0));
RedContainer((250, -280, 500), (0, 90, 0));
RedContainer((600, -280, 500), (0, 90, 0));
}
}
if(color == 2)
{
self.color = "2";
if(getDvar("mapname") == "mp_dockside")
{
iprintlnbold("Stand On The Color White");
wait 3;
level thread DeleteByModel("p6_dockside_container_lrg_orange");
level thread DeleteByModel("p6_dockside_container_lrg_blue");
level thread DeleteByModel("p6_dockside_container_lrg_red");
wait 3;
BlueContainer((-100, -140, 500), (0, 90, 0));
BlueContainer((250, -140, 500), (0, 90, 0));
BlueContainer((600, -140, 500), (0, 90, 0));
RedContainer((-100, -280, 500), (0, 90, 0));
RedContainer((250, -280, 500), (0, 90, 0));
RedContainer((600, -280, 500), (0, 90, 0));
OrangeContainer((-100, -420, 500), (0, 90, 0));
OrangeContainer((250, -420, 500), (0, 90, 0));
OrangeContainer((600, -420, 500), (0, 90, 0));
}
}
if(color == 3)
{
self.color = "3";
if(getDvar("mapname") == "mp_dockside")
{
iprintlnbold("Stand On The Color Blue");
wait 3;
level thread DeleteByModel("p6_dockside_container_lrg_orange");
level thread DeleteByModel("p6_dockside_container_lrg_white");
level thread DeleteByModel("p6_dockside_container_lrg_red");
wait 3;
WhiteContainer((-100, 0, 500), (0, 90, 0));
WhiteContainer((250, 0, 500), (0, 90, 0));
WhiteContainer((600, 0, 500), (0, 90, 0));
RedContainer((-100, -280, 500), (0, 90, 0));
RedContainer((250, -280, 500), (0, 90, 0));
RedContainer((600, -280, 500), (0, 90, 0));
OrangeContainer((-100, -420, 500), (0, 90, 0));
OrangeContainer((250, -420, 500), (0, 90, 0));
OrangeContainer((600, -420, 500), (0, 90, 0));
}
}
if(color == 4)
{
self.color = "4";
if(getDvar("mapname") == "mp_dockside")
{
iprintlnbold("Stand On The Color Red");
wait 3;
level thread DeleteByModel("p6_dockside_container_lrg_orange");
level thread DeleteByModel("p6_dockside_container_lrg_white");
level thread DeleteByModel("p6_dockside_container_lrg_blue");
wait 3;
WhiteContainer((-100, 0, 500), (0, 90, 0));
WhiteContainer((250, 0, 500), (0, 90, 0));
WhiteContainer((600, 0, 500), (0, 90, 0));
BlueContainer((-100, -140, 500), (0, 90, 0));
BlueContainer((250, -140, 500), (0, 90, 0));
BlueContainer((600, -140, 500), (0, 90, 0));
OrangeContainer((-100, -420, 500), (0, 90, 0));
OrangeContainer((250, -420, 500), (0, 90, 0));
OrangeContainer((600, -420, 500), (0, 90, 0));
}
}
}
08-28-2016, 02:36 PM #6
Originally posted by TotalModzHD View Post
Screenshot that code in your project and post it here.


But the code I'm using repeats infinitely, I only want it to repeat 3 times!
08-28-2016, 02:51 PM #7
Patrick
League Champion
Originally posted by Thomas
But the code I'm using repeats infinitely, I only want it to repeat 3 times!


     
Simpleloops()
{
for(e = 0; e < 3; e++)
{
Iprintln("Loop stage: "+e);
wait 7;
}
}
08-28-2016, 03:02 PM #8
Originally posted by Hypocrite View Post
     
Simpleloops()
{
for(e = 0; e < 3; e++)
{
Iprintln("Loop stage: "+e);
wait 7;
}
}


where would I put my command on that loop code?
08-28-2016, 03:20 PM #9
i also would like a code that would kill people if they fall down to a certain level!
Like a death barrier, but only at a certain point!
How should i go about coding that?

Thanks For Your Help Already! <3
08-28-2016, 03:24 PM #10
Originally posted by Thomas
where would I put my command on that loop code?


It works thanks, but after the loop is over is there a way to link it to another command?

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo