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

A door.

broken avatar :(
Created 12 years ago
by Ege115
0 Members and 1 Guest are viewing this topic.
4,016 views
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 2 years ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
Hello everyone, again.

I have a door in my map that I made a simple small script closes automatically when a player has entered a room. And I made the door close automatically by using a trigger radius.

And now there is a problem, if 2 to 4 players are playing and will open the door and then entering the room and behind them the door will close, so if 1 player have entered the room first then the door will close, and if the other players behind the player who have entered the room first the door will close and then the player can not go in to the room.
I hope know what I mean.

So my question is how do I make so the door is only closing when ALL the players are inside the room, like if 2 players are playing and then the first player has entered the room first, and the door will not close until the other player has entered the room too.

Is it something about
players = get players?
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
yeah, you also need to put in a trigger_multiple and do a check every 1 second if all players are touching it.
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 2 years ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
Any specific area were the trigger multiple should be?

By the way the door will only be used once, first a trigger use that opens the door, then when the players are inside the room, the door will close then the script has done its work, nothing else.
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
Any specific area were the trigger multiple should be?

By the way the door will only be used once, first a trigger use that opens the door, then when the players are inside the room, the door will close then the script has done its work, nothing else.
the trigger multiple should cover the area where you want all players to stand in and the door will close.
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 2 years ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
Oh thought that I still was going to have the trigger radius and the multiple to an another thing to the door.

However the door is closing with the trigger multiple as good as the radius does, but now I don't know if it closes when all the players are inside the room if you play coop because now I just tested this in solo, but I'll see if it is closing when the all the players are in the room later.

But with the trigger the script looks something like this.

waittill trigger, bla bla bla (This is the trigger multiple)
players = get_players();
movex (100, 3);


I don't remember how it looked like but it was something like that.
Thank you so much for the help Ray!

broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
it will trigger when even a zombie will touch it.
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 2 years ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
does'nt matter the doors will be at a place were the zombies can't get to anyway.
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
does'nt matter the doors will be at a place were the zombies can't get to anyway.
You should also add this before the door closing
Code Snippet
Plaintext
players = GetPlayers();
all_players_in = false;
players_in = 0;
while(!all_players_in)
{
    for(i = 0;i<players.size;i++)
    {
          if(players[i] isTouching(triggerEntity)
          {
                players_in++;
          }
    }
    if(players_in == players.size)
    {
          all_players_in = true;
    }
    wait(1);
}
This will check if all players are touching the trigger multiple.
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 2 years ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
It gave me bad syntax, here is a part of the script, there is much more than just these lines.

Code Snippet
Plaintext
close_trigger1 = getent ("close_trigger1", "targetname");
close_trigger1 waittill ("trigger");
players = GetPlayers();
all_players_in = false;
players_in = 0;
while(!all_players_in)
{
    for(i = 0;i<players.size;i++)
    {
          if(players[i] isTouching(triggerEntity)
          {
                players_in++;
          }
    }
    if(players_in == players.size)
    {
          all_players_in = true;
    }
    wait(1);
}

eleclip show();
left_eledoor movex(65,3); //
egetrigger = getent ("egetrigger", "targetname");
egetrigger waittill ("trigger");

Post Merge: December 07, 2013, 08:17:50 pm
Darn it, forgot to make a script window, I always forget that sorry, I promise to do it from now on.
Last Edit: December 08, 2013, 10:29:13 pm by SajeOne
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
It gave me bad syntax, here is a part of the script, there is much more than just these lines.

close_trigger1 = getent ("close_trigger1", "targetname");
close_trigger1 waittill ("trigger");
players = GetPlayers();
all_players_in = false;
players_in = 0;
while(!all_players_in)
{
    for(i = 0;i<players.size;i++)
    {
          if(players isTouching(triggerEntity)
          {
                players_in++;
          }
    }
    if(players_in == players.size)
    {
          all_players_in = true;
    }
    wait(1);
}

eleclip show();
left_eledoor movex(65,3); //
egetrigger = getent ("egetrigger", "targetname");
egetrigger waittill ("trigger");

Post Merge: December 07, 2013, 08:17:50 pm
Darn it, forgot to make a script window, I always forget that sorry, I promise to do it from now on.
change triggerEntity in the if to close_trigger1
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 2 years ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
No that seems not to be the problem, the developer 1 says that it is this { that makes the error but which one is the question.



Post Merge: December 08, 2013, 09:48:23 pm
I can't really find the error in this script you gave me Ray, But look at line 9 of the script (the one you gave me Ray) and it is this { that cause the error apperently, but I don't really know what to do, I have tried different solutions but I have no luck.

Last Edit: December 08, 2013, 09:48:23 pm by Ege115
broken avatar :(
×
broken avatar :(
Former UGX Lead Asset Creator
Location: ca
Date Registered: 17 August 2012
Last active: 7 years ago
Posts
1,932
Respect
Forum Rank
Zombie Destroyer
Primary Group
UGX V.I.P.
My Groups
More
My Contact & Social Links
More
Personal Quote
Eh?
Signature

(Click to enter portfolio)
×
SajeOne's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
@Ege115 In the future please use code tags when posting code. This is your first and only verbal warning. If actions continue account warnings will be issued.
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 2 years ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
I am so absoultely sorry Sajeone, but I actually try to do it but when I do it, it does'nt work, no code tag pops up when I want to do it, I actually click insert code and when I want to make smileys it does'nt work nothing comes up on my post, I did click insert code on this post too but instead it appeared to be like this as it is on this post right now, I can't help.
I honestly have a lots of question that I want to ask everyone and learn here but I try to make as few posts as possible because the posts options does'nt work for me. If it worked I would have more posts than this.
I am so sorry Sajeone.
Well this is embarrasing, sorry.
broken avatar :(
×
broken avatar :(
Former UGX Lead Asset Creator
Location: ca
Date Registered: 17 August 2012
Last active: 7 years ago
Posts
1,932
Respect
Forum Rank
Zombie Destroyer
Primary Group
UGX V.I.P.
My Groups
More
My Contact & Social Links
More
Personal Quote
Eh?
×
SajeOne's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
I am so absoultely sorry Sajeone, but I actually try to do it but when I do it, it does'nt work, no code tag pops up when I want to do it, I actually click insert code and when I want to make smileys it does'nt work nothing comes up on my post, I did click insert code on this post too but instead it appeared to be like this as it is on this post right now, I can't help.
I honestly have a lots of question that I want to ask everyone and learn here but I try to make as few posts as possible because the posts options does'nt work for me. If it worked I would have more posts than this.
I am so sorry Sajeone.
Well this is embarrasing, sorry.
It's ok, things happen, just make sure to read the rules as it is something that is included there. As for the code tags with chrome there are some issues the buttons seem to have with it. It's a known issue which I don't know the progress of the fixing of at the moment. You can add code tags manually like this:

Code Snippet
Plaintext
[code] /*MY CODE*/ 
[/code] <-- end tag

 
Loading ...