Forum
CS2D Scripts Lua Scripts/Questions/HelpBut it doesnt works, i put the sounds.. Where is the Problem?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
-- INITIAL SETUP -- ----------------------- function initArray(m) 	local array = {} 	for i = 1, m do 		array[i]=0 	end 	return array end sample.ut.timer=initArray(32) sample.ut.level=initArray(32) sample.ut.fblood=0 ----------------------- -- PREPARE TO FIGHT! -- ----------------------- addhook("startround","sample.ut.startround") function sample.ut.startround() 	parse("sv_sound \"female/prepare.wav\"") 	sample.ut.fblood=0 end ----------------------- -- KILL SOUNDS+MSGS -- ----------------------- addhook("kill","sample.ut.kill") function sample.ut.kill(killer,victim,weapon) 	if (os.clock()-sample.ut.timer[killer])>3 then 		sample.ut.level[killer]=0; 	end 	level=sample.ut.level[killer] 	level=level+1 	sample.ut.level[killer]=level 	sample.ut.timer[killer]=os.clock() 	-- FIRST BLOOD? 	if (sample.ut.fblood==0) then 		sample.ut.fblood=1 		parse("sv_sound \"fun/firstblood.wav\""); 		msg (player(killer,"name").." sheds FIRST BLOOD by killing "..player(victim,"name").."!") 	end 	-- HUMILIATION? (KNIFEKILL) 	if (weapon==50) then 		-- HUMILIATION! 		parse("sv_sound \"female/f_humiliation.wav\""); 		msg (player(killer,"name").." humiliated "..player(victim,"name").."!") 	else 		-- REGULAR KILL 		if (level==1) then 			-- Single Kill! Nothing Special! 		elseif (level==2) then 			parse("sv_sound \"female/f_multikill.wav\""); 			msg (player(killer,"name").." made a Multikill!") 		elseif (level==3) then 			parse("sv_sound \"female/f_megakill.wav\"") 			msg (player(killer,"name").." made a Megakill!") 		elseif (level==4) then 			parse("sv_sound \"female/f_ultrakill.wav\"") 			msg (player(killer,"name").." made an ULTRAKILL!") 		elseif (level==5) then 			parse("sv_sound \"female/f_monsterkill.wav\"") 			msg (player(killer,"name").." made a MO-O-O-O-ONSTERKILL-ILL-ILL!") elseif (level==6) then parse("sv_sound \"female/f_ludacrisskill.wav\"") msg (player(killer,"name").." made a LUDICROUS KILL-LL-LL-LL!") elseif (level==7) then parse("sv_sound \"female/f_holyshit.wav\"") msg (player(killer,"name").." made a HOLYSHIT!") elseif (level==8) then parse("sv_sound \"female/f_godlike.wav\"") msg (player(killer,"name").." made a GODLIKE!") elseif (level==9) then parse("sv_sound \"female/f_wickedsick.wav\"") msg (player(killer,"name").." made a Wicked-Sick!!") 	 		else 			parse("sv_sound \"female/f_unstoppable.wav\"") 			msg (player(killer,"name").." is UNSTOPPABLE! "..level.." KILLS!") 		end 	end end
mat5b has written
How to compare values that are NOT equal to themselves. I mean something like value1-=value2, or value1~=value2. What do you think?
Do you mean...
1
2
3
4
2
3
4
if x <= y then... if x >= y then... if x ~= y then... if not x == y then...
@Smither:
What's this?
1
parse("sv_sound \"female/f_multikill.wav\"");
Just keep it simple like this
1
parse("sv_sound 'female/f_multikill.wav'")
It says that a end is expected at 75 <eof> or something.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
---------------------- -- Ultimate Female Sounds Script by Xt3ND3d -- -- Version 0.5 Alpha -- -- © 11.09.2009 Xt3ND3d Productions -- ----------------------- function initArray(m) local array = {} for i = 1, m do array[i]=0 end return array end sample.ut.timer=initArray(32) sample.ut.level=initArray(32) sample.ut.fblood=0 ----------------------- -- Killing sounds and messages -- ----------------------- addhook("kill","sample.ut.kill") function sample.ut.kill(killer,victim,weapon) if (os.clock()-sample.ut.timer[killer])>3 then sample.ut.level[killer]=0; end level=sample.ut.level[killer] level=level+1 sample.ut.level[killer]=level sample.ut.timer[killer]=os.clock() -- Humiliation (Killed with knife) if (weapon==50) then parse("sv_sound 'fun/f_humiliation.wav'"); msg (player(killer,"name").." humiliated "..player(victim,"name").."!") msg "You humiliated me..." else -- First kill. if (level==1) then -- Doesn't do nothing at his point. if (level==2) then -- Doesn't do anything either. This is unfinished version. elseif (level==3) then -- Megakill. parse("sv_sound 'fun/f_megakill.wav'") msg (player(killer,"name").." made a Megakill!") elseif (level==4) then -- Ultrakill. parse("sv_sound 'fun/f_ultrakill.wav'") msg (player(killer,"name").." made an ULTRAKILL.") elseif (level==5) then -- Monsterkill. parse("sv_sound 'fun/f_monsterkill.wav'") msg (player(killer,"name").." made a MONSTERKILL! W00t!") elseif (level==6) then -- Ludacriskill. parse("sv_sound 'fun/f_ludacrisskill.wav'") msg (player(killer,"name").." made a LUDACRISKILL!") elseif (level==7) then -- Holyshit. parse("sv_sound \"fun/f_holyshit.wav\"") msg (player(killer,"name").." made a HOLYSHIT!") elseif (level==8) then -- Godlike. parse("sv_sound \"fun/f_godlike.wav\"") msg (player(killer,"name").." is a GODLIKE!!!") elseif (level==9) then -- Wicked-Sick. parse("sv_sound \"fun/f_wickedsick.wav\"") msg (player(killer,"name").." made a Wiiickeeed-Siiick!!") else parse("sv_sound \"fun/f_unstoppable.wav\"") msg (player(killer,"name").." is UNNNSTOPPABLE...! Made "..level.." kills!!!") end end end
Where?
--- Edit ---
Didn't actually saw Smither's post. But my problem is still other. I didn't steal nothing, I promise in case you think I stole from him.
open sys/lua/samples/utsfx.lua
there is the original script. it works and is readable because it is properly indented.
it's okay that people take and modify my sample scripts. that's why they are there. however it's not okay to fuck up the indent. It's really horrible to see how this script has been ruined!
Maybe he thinks he understands it better without the tabs...
of course it's hard to find the right position for the missing end in this script. no indent = WAR!!!
you would INSTANTLY see the problem with proper indent.
this is a script i want to make so just tell me how to fix it dont fix it for me
1
2
3
2
3
parse("equip "..id.." 45") then parse("equip "..id.." 83") then parse("speedmod "..id.." 25") then
The then keyword can only be postfixed to an if statement. IE: Take off the 'then' from the none-if statements.
well heres the hardest one (it was hard for me)i made today.
what it does
speedmod 25 (when you say !godlike)
ivincibilty (when you say !godlike)
laser (when you say !godlike)
super armor (when you say !godlike)
godlike sfx (when you say !godlike)
players name is godlike (msg "playersname is godlike")
and soon infinit grenades.(possibly)
edited 6×, last 12.09.09 09:39:22 am
Banana-Phone has written
how ccan i make a script in when finish the round change the terrorist
You mean each round start make everyone terrorists?
Im not on my PC so I cant make script for you.
But, if you know how to script a bit,
I will show how it should work:
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
function round() 	local i 	for i = 1,32 do 		if (player(i,"team") == 2) then 			parse('maket '..i) 		end 	end end
Anyway same thing is already in my zombie plague 1.0
edited 1×, last 12.09.09 12:31:10 pm
Indents, values, wtf is that?
I just edited and made all stuff organised. Don't see problem...
rogue that
I fixed them and still same...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
---------------------- -- Ultimate Female Sounds Script by Xt3ND3d -- -- Version 0.5 Alpha -- -- © 11.09.2009 Xt3ND3d Productions -- ----------------------- function initArray(m) local array = {} for i = 1, m do array[i]=0 end return array end sample.ut.timer=initArray(32) sample.ut.level=initArray(32) sample.ut.fblood=0 ----------------------- -- Killing sounds and messages -- ----------------------- addhook("kill","sample.ut.kill") function sample.ut.kill(killer,victim,weapon) if (os.clock()-sample.ut.timer[killer])>3 then sample.ut.level[killer]=0; end level=sample.ut.level[killer] level=level+1 sample.ut.level[killer]=level sample.ut.timer[killer]=os.clock() -- Humiliation (Killed with knife) if (weapon==50) then parse("sv_sound 'fun/f_humiliation.wav'"); msg (player(killer,"name").." humiliated "..player(victim,"name").."!") msg "You humiliated me..." else -- First kill. if (level==1) then -- Doesn't do nothing at his point. if (level==2) then -- Doesn't do anything either. This is unfinished version. elseif (level==3) then -- Megakill. parse("sv_sound 'fun/f_megakill.wav'") msg (player(killer,"name").." made a Megakill!") elseif (level==4) then -- Ultrakill. parse("sv_sound 'fun/f_ultrakill.wav'") msg (player(killer,"name").." made an ULTRAKILL.") elseif (level==5) then -- Monsterkill. parse("sv_sound 'fun/f_monsterkill.wav'") msg (player(killer,"name").." made a MONSTERKILL! W00t!") elseif (level==6) then -- Ludacriskill. parse("sv_sound 'fun/f_ludacrisskill.wav'") msg (player(killer,"name").." made a LUDACRISKILL!") elseif (level==7) then -- Holyshit. parse("sv_sound 'fun/f_holyshit.wav'") msg (player(killer,"name").." made a HOLYSHIT!") elseif (level==8) then -- Godlike. parse("sv_sound 'fun/f_godlike.wav'") msg (player(killer,"name").." is a GODLIKE!!!") elseif (level==9) then -- Wicked-Sick. parse("sv_sound 'fun/f_wickedsick.wav'") msg (player(killer,"name").." made a Wiiickeeed-Siiick!!") else parse("sv_sound 'fun/f_unstoppable.wav\'") msg (player(killer,"name").." is UNNNSTOPPABLE...! Made "..level.." kills!!!") end end end
Error: 'end' expected at line 22 (near <eof>).
WTF?