Forum

> > CS2D > General > Could someone make me a simple Lua script?
Forums overviewCS2D overviewGeneral overviewLog in to reply

English Could someone make me a simple Lua script?

7 replies
To the start Previous 1 Next To the start

old Re: Could someone make me a simple Lua script?

SQ
Moderator Off Offline

Quote
I havent tested , but that should work:

1
2
3
4
5
6
7
8
9
timeculc =1
addhook("minute","advertising")
function advertising()
	timeculc=timeculc+1
	if timeculc>4 then
		msg("Please press F1 to read the rules!")
		timeculc=1
	end
end
edited 4×, last 01.07.09 10:28:07 pm

old Re: Could someone make me a simple Lua script?

MiroslavR
User Off Offline

Quote
Or you can use this way:

1
2
3
4
5
6
7
8
9
10
timer = os.clock()
minutes = 4

addhook("always", "advertising")
function advertising()
	if (os.clock()-timer)>=(60*minutes) then
		msg("Welcome to my server!")
		timer = os.clock()
	end
end

old Re: Could someone make me a simple Lua script?

ohaz
User Off Offline

Quote
Yes, always hooks can make the server slower, because they get hooked every frame. If you have Servers with more than one always hook, it could cause horrible lags.
So you should better use second oder minute hooks.
To the start Previous 1 Next To the start
Log in to replyGeneral overviewCS2D overviewForums overview