Forum

> > CS2D > Scripts > First infection Lua
Forums overviewCS2D overview Scripts overviewLog in to reply

English First infection Lua

11 replies
To the start Previous 1 Next To the start

old First infection Lua

kewixasd
User Off Offline

Quote
Hello.
im going to come to you for help.
First infection lua script would need.
Which counts back to 30 seconds until the first infection.

id be grateful for your help.xxd
edited 1×, last 07.09.21 06:29:10 pm

old Re: First infection Lua

Mami Tomoe
User Playing CS2D

Quote
Then if it's simple, you can make it yourself.

Or... Just use the script above (or similar scripts) and strip out the parts that you do not need.

old Re: First infection Lua

Bowlinghead
User Off Offline

Quote
If someone like user kewixasd would form an understandable sentence with exact criteria what he wants and what the script shall be able to do... Maybe some people would be engaged to help him.
Quote
First infection lua script would need.
Which counts back to 30 seconds until the first infection.

All I understand is a script that writes "first infection" after 30secs.
Either way, it takes time to help you, wether it is the script itself or pasting some code or giving references - whatever. So YOU should take time to write those posts TOO - that is part of being thankful, atleast in my opinion.

old Re: First infection Lua

ohaz
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
addhook("startround", "start_countdown")
addhook("second", "countdown_count")

countdown_running = false
countdown_remaining = 30

function start_countdown(mode)
	countdown_remaining = 30
	countdown_running = true
end

function countdown_count()
	if (countdown_running) then
		countdown_remaining = countdown_remaining - 1
		msg("Time remaining " .. countdown_remaining)
		if (countdown_remaining <= 0) then
			countdown_running = false
			msg("Infection")
		end
	end
end
edited 1×, last 07.09.21 07:38:05 pm

old Re: First infection Lua

Mami Tomoe
User Playing CS2D

Quote
user Xirot has written
Just paste the code or do not reply dude.

Oh, you're a moderator now?

@user ohaz:
I'm fairly certain he wants a random survivor to transform into a zombie.
Which means the following:
All players should become survivors on round start.
A random survivor should become a zombie after the countdown ends.

Also, you can't use
-=
in Lua.

old Re: First infection Lua

ohaz
User Off Offline

Quote
user Mami Tomoe has written
@user ohaz:
I'm fairly certain he wants a random survivor to transform into a zombie.
Which means the following:
All players should become survivors on round start.
A random survivor should become a zombie after the countdown ends.
They haven't asked for that though. I have implemented exactly what they asked for.

Quote
Also, you can't use
-=
in Lua.

Thanks for the hint with the -=, I haven't coded in Lua in ages.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview