Forum

> > CS2D > Scripts > Free day script?
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Free day script?

13 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Free day script?

zazz
User Off Offline

Zitieren
Hey guys, i don't know anything about scripting.
So i would like to ask you, if someone knows, or can make a Freeday script for me? i want to put it on my jail map.

What does freeday mean?:
Rarely, at the start of a new round
A text will appear saying "Freeday, kill em' all"
And weapons will spawn near the terrorist spawn.

Can you be especific please? i'm new to this scripting stuff, and my brain doesn't have enough RAM to know it

Thanks

alt Re: Free day script?

Rainoth
Moderator Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
addhook("startround","_s")
function _s(mode) -- on start of the round
local chance = math.random(1,100) -- lets get a chance (number from 1 to 100)
	if chance <= 20 then -- (if it's 20 or below, in other words, 20 out of 100 rounds will meet the criteria)
		msg("Free day") -- then free day will begin
		parse("spawnitem 69 4 20") -- and item 69 will be 
placed at tile 4|20
		for i = 1,10 do
			parse("trigger prison_door"..i) -- prison_door1, prison_door2, ..., prison_door10 will be triggered
		end
	end
end

Copy + Paste + Edit = Profit.

// Edit with opening door
1× editiert, zuletzt 31.10.15 01:41:35

alt Re: Free day script?

J192
User Off Offline

Zitieren
@user Talented Doge: What? user Rainoth's script completely eliminates the need of giving them the same name.
Giving them identical names will also disallow you from opening doors individually, so it's stupid.

alt Re: Free day script?

Gaios
Reviewer Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
addhook('startround','_startround',-22)
function _startround()
	if math.random(1,100) <= 20 then
		local weaponList = {30,3} -- here enter all weapons that can be spawned for Terrorists
		local howManyDoors = 0 -- in Func_DynWall set name for doors like: prison_door1, prison_door2 ... prison_door10
		local customDoors = {'example','test'} -- here just enter names of Func_DynWall that another than prison_door
		
		for _, id in pairs(player(0,'team1living')) do
			parse('spawnitem '..weaponList[math.random(1,#weaponList)]..' '..player(id,'tilex')..' '..player(id,'tiley'))
		end
		for i = 1, howManyDoors do
			parse('trigger prison_door'..i)
		end
		for _, i in pairs(customDoors) do
			parse('trigger '..i)
		end
		msg("\169255000000Freeday, kill em' all @C")
	end
end

alt Re: Free day script?

Jite
User Off Offline

Zitieren
@user zazz: like @user DaisukeOno: already said it isn't necessary to create a script for this function. I repeat me here now, i also answered you at the fws webside,...

You only need a:

> Trigger_start
> Trigger_if

1
( math.random(1, 100) <= xx )

fill this in the trigger_if line and chose out what should get triggered with the probability of xx
xx = a number betwenn 100 - 0, if you fill in 30, the trigger_if will trigger with a probability of 30%

the trigger_start trigger the trigger_if

alt Re: Free day script?

apex2d
User Off Offline

Zitieren
this idea is from the "California Jail" by the way the map uses a move trigger that breaks the explode block that breaks the freeday trigger, and the weapons are triggered by start so they will not spawn when its not freeday, and spawned when the freeday block breaks,

alt Re: Free day script?

zazz
User Off Offline

Zitieren
Thanks for the late help lol.
I aldready solved this, and finished the map
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht