Forum

> > CS2D > Scripts > Script with "Second"
Forums overviewCS2D overview Scripts overviewLog in to reply

English Script with "Second"

25 replies
Page
To the start Previous 1 2 Next To the start

old Re: Script with "Second"

Alistaire
User Off Offline

Quote
Add dis = 0 once anywhere outside of a function. Best is to declare the like at the beginning of a script.

old Re: Script with "Second"

J4x
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
---VARIABLES---

min_dis = 3
dis = 0
---------

addhook("minute","rand_dis")

function rand_dis()
     dis = dis + 1
     if dis == min_dis then
          dis = 0
          rand_dis1 = 1
     end
end

old Re: Script with "Second"

Kostyan1996
User Off Offline

Quote
Oh, thanks and sorry, if I didn't understand you right in last message (I'm not english-speaking and can't understand all of your words and offers)...
---
Hm, make this, but script won't work though...
edited 1×, last 27.06.12 09:00:04 am

old Re: Script with "Second"

EngiN33R
Moderator Off Offline

Quote
Well, for me user J4x's code works on a smaller scale (with a second hook), so I don't see why it wouldn't work on its proper scale.

old Re: Script with "Second"

EngiN33R
Moderator Off Offline

Quote
You need to declare the function before calling it.

1
2
3
4
5
6
7
8
9
10
11
12
test()

function test()
	print("Test")
end
--The above won't work
--This, however, will:
function test()
	print("Test")
end

test()
To the start Previous 1 2 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview