Jump to content
Vivi3n

Activate pvp after a timer

Recommended Posts

I prepare a pvp capture the flag gamemode for me and my friends and i wanted to have a start without pvp, and i dont find the variable to affect all player, what i'm supposed to use or do to say to my script to affect everybody on the map ?

can i use their team ? role maybe ? or did I missed the right variable ?

Annotation 2019-12-08 152123.png

Share this post


Link to post
Share on other sites
7 hours ago, Vivi3n said:

I prepare a pvp capture the flag gamemode for me and my friends and i wanted to have a start without pvp, and i dont find the variable to affect all player, what i'm supposed to use or do to say to my script to affect everybody on the map ?

can i use their team ? role maybe ? or did I missed the right variable ?

Annotation 2019-12-08 152123.png

I'll try to give you an answer tomorrow.

Share this post


Link to post
Share on other sites

Hey @Vivi3n

You will first need to make a variable that adds every player to the game

First create a global variable and go into edit script.

Create a variable called "Player List"  (MAKE SURE YOU ENABLE ARRAY CHECK BOX)

image.thumb.png.31f76621d39290c5c2089775677a58eb.png

Then go inside your spawn point logic and add this.

image.thumb.png.f233fed75778445653a609a60abe6c71.png

Then to enable all of those players to enable/disable pvp you do this

image.thumb.png.1dec5c3125d37dce6577c6494d255783.png

Please note that there are different types of immunity you can choose from...pvp immunity...jump immunity, full invincibility, etc.

 

If you want all players that connect to your game to be immune on start, do this.

image.png.2fb10339daf75ec46c440573dc22870c.png

Good luck creator!

Edited by Igor Q.

Share this post


Link to post
Share on other sites
31 minutes ago, Igor Q. said:

You will first need to make a variable that adds every player to the game

Use a Player Role (use only one so they are all listed together).  It's an array, and you don't have to write any code to add players to it.  You can also use an Entity Label that you add when they Spawn or Connect, but the Player Role manages itself which really helps code stay simple.  No special code is needed in case a player leaves the game.

You will still need to use a loop to set each player's immunity.

You can use Player Team if you want, but if you have more than one team, then you will need more than one loop.

 

Ylands_191208_181454.thumb.png.43c8f6cca5fdbb0a8b241e2609d980e8.png

 

Ylands_191208_181528.png.ab95c164c77ba235e416140e1f1a7ba2.png

 

Ylands_191208_181330.png.aa77ae0c73c6db80257801f4ea5f83a8.png

 

This last piece of code would be triggered by the timer, or lever, or whatever way you are deciding to start the action.

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×