Forum

> > CS2D > Scripts > round select
Forums overviewCS2D overview Scripts overviewLog in to reply

English round select

10 replies
To the start Previous 1 Next To the start

old round select

nvdie
User Off Offline

Quote
I need a script that will select 1 round from 15 that will activate one of the two env_explode and two dynwall

env_explode 1 > hlle
env_explode 2 > pty
----------------
dynwall 1 > ptyd
dynwall 2 > hlled

Note: Will select 1 in 15 rounds and will activate a pair of explode and dynwall, pair 1 or pair 2

pair 1 > hlle, ptyd
pair 2 > pty, hlled

sorry for bad english

old Re: round select

Rainoth
Moderator Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
rounds = {
	triggers = {{"hlle","ptyd"},{"pty","hlled"}},
	set = function()
		rounds.chosen = math.random(1,15)
	end,
	select = function()
		for k,v in pairs(rounds.triggers[math.random(1,2)]) do
			parse("trigger "..v)
		end
	end
}
How to use:
1. Call 'rounds.set()' every 15 rounds
2. Insert this code where you want to do the triggering
If rounds.chosen and rounds.chosen == YOUR_ROUNDS_VARIABLE then
	rounds.select()
end


Good luck.

old Re: round select

nvdie
User Off Offline

Quote
I want it between 15 rounds 1 will activate explode hlle, ptyd or pty, hlled
edited 1×, last 16.01.17 05:25:11 pm

old Re: round select

nvdie
User Off Offline

Quote
I do not understand anything about lua script, explain me where I put it on the map or in a script '-_-

old Re: round select

Rainoth
Moderator Off Offline

Quote
Okay.
Step 1: Find the variable for your rounds. It is probably named something like "round" or some other generic bs.
Step 2: Now find the exact same thing but it has to have
"round = round +1" or something similar
Step 3: Put the 'if' code that I provided at the end of my first post and change "YOUR_ROUNDS_VARIABLE" into your rounds variable (in this example it is 'round')

Good luck.

old Re: round select

nvdie
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
rounds = {
     triggers = {{"hlle","ptyd"},{"pty","hlled"}},
     set = function()
          rounds.chosen = math.random(1,15)
     end,
     select = function()
          for k,v in pairs(rounds.triggers[math.random(1,2)]) do
               parse("trigger "..v)
          end
     end
}
If rounds.chosen and rounds.chosen == round then
     rounds.select()
end
like this?

old Re: round select

Rainoth
Moderator Off Offline

Quote
No. You just copy-pasted my code.
Take the code I gave you. Put it at the very top.
Take the 'if' code I gave you and put it where your rounds variable is updated.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview