Playerenters Bug

I’ve put it up on youtube to show you what is happening.

http://www.youtube.com/watch?v=I3TO66FU1y8

if (created)
  dontblock;
  setimg light2.png;
if (playerenters) {
  setcoloreffect .8,.2,0.1,0.7;
  drawaslight;
  this.light = 2;
  timeout = 0.05;
}
if (timeout) {
  this.light += random(-0.1,0.1);
  if (!(this.light in |1,3|))
    this.light = 2;
  setzoomeffect this.light;
  timeout = 0.05;
}

2 Reasons.

  1. All global variables are sent in increments of 0.5. This includes each RGB, Zoom, And Alpha.
  2. Timeouts/Loops only run for the “leader” of the level. Once the leader leaves, the player who is next in line begins running loops.

It is not related to playerenters;

However on that note, “if(created){}” is broken, the script only runs “once”, the moment the level is loaded and a player runs the command. Instead of “once per player” as it should.

And…
if (created)
dontblock;
setimg light2.png;

You have “setimg light2.png” outside of a conditional.

If you want other players to run loops, use “timereverywhere” within a player enters.
If you do not want each player’s NPC data spamming up your GServer and other players with packets, and sending “conflicting stats”. Use a showimg instead, unless in a weapon with an index below 200 (300?), they remain localized.

Thanks beholder, I guess there are some things I forgot and some new things to learn about Reborn :wink: