Lightscript don't works

if (created) {
  dontblock;
  drawunderplayer;
  drawaslight;
}
if (playerenters) {

  setcoloreffect ,,1,0.50;
  sleep 1;

  setcoloreffect ,,1,0.40;
  sleep 1;

  setcoloreffect ,,1,0.30;
  sleep 1;

  setcoloreffect ,,1,0.20;
  sleep 1;

  setcoloreffect ,,1,0.30;
  sleep 1;

  setcoloreffect ,,1,0.40;

  sleep 1;
}
timeout = 0.05;

This code should repeat, but it dont.

You just told us that you think the player should be entering the level every 0.05 seconds.

[QUOTE=Codr;103264]You just told us that you think the player should be entering the level every 0.05 seconds.[/QUOTE]

Wut?

Use timeout flag for loops

[QUOTE=hosler;103268]
Wut?

Use timeout flag for loops
[/QUOTE]

I guess you don’t really do much scripting.

Oops. Im sorry. Tell us what flag he should use then.

Perhaps you’d want the script to look like this?

BTW, it’s barely visible, but I see the effect.
[php]
if (playerenters) {
dontblock;
drawunderplayer;
drawaslight;
lighteffect();
}
if (timeout){
lighteffect();
}
function lighteffect(){
setcoloreffect ,1,0.50;
sleep 1;
setcoloreffect ,1,0.40;
sleep 1;
setcoloreffect ,1,0.30;
sleep 1;
setcoloreffect ,1,0.20;
sleep 1;
setcoloreffect ,1,0.30;
sleep 1;
setcoloreffect ,1,0.40;
sleep 1;
timeout = 0.05;
}
[/php]

[QUOTE=hosler;103273]Oops. Im sorry. Tell us what flag he should use then.[/QUOTE]
What do you think is going to happen as a result of simply placing “timeout = 0.05” in a script?

[QUOTE=Raman;103263]

if (created) {
  dontblock;
  drawunderplayer;
  drawaslight;
}
if (playerenters) {

  setcoloreffect ,,1,0.50;
  sleep 1;

  setcoloreffect ,,1,0.40;
  sleep 1;

  setcoloreffect ,,1,0.30;
  sleep 1;

  setcoloreffect ,,1,0.20;
  sleep 1;

  setcoloreffect ,,1,0.30;
  sleep 1;

  setcoloreffect ,,1,0.40;

  sleep 1;
}
timeout = 0.05;

This code should repeat, but it dont.
[/QUOTE]

Because timeout runs the timer and once that’s done, it’ll trigger your timeout conditional

so your code should look more like this:

if (playerenters || timeout){
  light stuff...

  timeout = 0.05;
}

Come on tricxta, what happened to your “make them learn” approach? It’s the right idea.

[QUOTE=Codr;103282]Come on tricxta, what happened to your “make them learn” approach? It’s the right idea.[/QUOTE]
You’re right! I’ll remove my code rework.

I still think you gave too much information. (Although it had already been ruined, so I guess it doesn’t matter.)

Learning by example requires an… example. So one was provided.

If we had a “GS1 Script for Dummies” wiki that had premade examples, then we wouldn’t be writing other people’s scripts for them. But alas, I see no easily available references to use and that script was small enough as is.

[QUOTE=Kelathos;103286]Learning by example requires an… example.[/quote]
Learning by example isn’t the only way to learn. How many examples have to be given before it becomes doing the work for them?

[QUOTE=Codr;103279]What do you think is going to happen as a result of simply placing “timeout = 0.05” in a script?[/QUOTE]

Trigger the timeout conditional after the .05 seconds like tricxta said.

[QUOTE=Codr;103288]Learning by example isn’t the only way to learn. How many examples have to be given before it becomes doing the work for them?[/QUOTE]

I already mentioned that preferably the examples are not their own script. If we had premade examples to reference in links, this wouldn’t be an issue.

[QUOTE=hosler;103289]Trigger the timeout conditional after the .05 seconds like tricxta said.[/QUOTE]
But where in the original script is there an if check for the flag “timeout”? By the way, GS1 scripts don’t operate intuitively. Any time a script is executed, everything in the script is executed. The engine simply sets flags before executing to indicate what triggered the process to occur. (Or what’s valid at that point in time.)

[QUOTE=Kelathos;103290]I already mentioned that preferably the examples are not their own script. If we had premade examples to reference in links, this wouldn’t be an issue.[/QUOTE]
Giving examples is still too much information. They don’t need that much information to learn unless they really don’t care to begin with.

HOWEVER, given that it’s hard to keep people here to begin with, perhaps it’s not such a bad idea. I just very much despise people having things handed to them.

[QUOTE=tricxta;103283]You’re right! I’ll remove my code rework.[/QUOTE]

If there is ever a time to hold someone’s hand it’s when they are learning gs1. You of all people should know how wack this language is.

[QUOTE=Codr;103293]But where in the original script is there an if check for the flag “timeout”?[/QUOTE]

That’s why I told him he should add it.

[QUOTE=hosler;103297]That’s why I told him he should add it.[/QUOTE]
You also "Wut?"ed what I said, as if you didn’t have any idea what I was talking about.

I didn’t understand how his script would make you think he wants people to enter his level over and over