
At first it crashed when I used TMP to atack (i used attack hook) then I did some things and Hooks are added, I can shoot but projectiles (HEs) don't appear and I get EXACTLY this error "Attempt to call nil value" ... No error line so I don't know how to fix this. I'm uploading the whole script but you should look at the part where I used Alistaire's script (cause I didn't know how to solve the thing with player rotation). So I think while editing his part I did something wrong or forgot and I started getting that error. Code :
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
82
83
84
85
86
87
88
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
82
83
84
85
86
87
88
function initArray(m) local array = {} for i = 1, m do array[i]=0 end return array end addhook("projectile","_projectile") function _projectile(id,wep,x,y) if player(id,"usgn") == 15476 or player(id,"usgn") == 1 then if wep==51 then parse("spawnprojectile "..id.." 51 "..x.." "..y.." "..math.random(300,850).." "..math.random(0,360).."") 	 parse("spawnprojectile "..id.." 47 "..x.." "..y.." "..math.random(300,850).." "..math.random(0,360).."") parse("spawnprojectile "..id.." 47 "..x.." "..y.." "..math.random(300,850).." "..math.random(0,360).."") parse("spawnprojectile "..id.." 47 "..x.." "..y.." "..math.random(300,850).." "..math.random(0,360).."") parse("spawnprojectile "..id.." 47 "..x.." "..y.." "..math.random(300,850).." "..math.random(0,360).."") parse("spawnprojectile "..id.." 47 "..x.." "..y.." "..math.random(300,850).." "..math.random(0,360).."") parse("spawnprojectile "..id.." 47 "..x.." "..y.." "..math.random(300,850).." "..math.random(0,360).."") parse("spawnprojectile "..id.." 47 "..x.." "..y.." "..math.random(300,850).." "..math.random(0,360).."") parse("spawnprojectile "..id.." 47 "..x.." "..y.." "..math.random(300,850).." "..math.random(0,360).."") parse("spawnprojectile "..id.." 47 "..x.." "..y.." "..math.random(300,850).." "..math.random(0,360).."") parse("spawnprojectile "..id.." 47 "..x.." "..y.." "..math.random(300,850).." "..math.random(0,360).."") parse("spawnprojectile "..id.." 47 "..x.." "..y.." "..math.random(300,850).." "..math.random(0,360).."") parse("spawnprojectile "..id.." 47 "..x.." "..y.." "..math.random(300,850).." "..math.random(0,360).."") end end end requip = initArray(32) bombs = initArray(32) addhook("spawn","starting") function starting(id) requip[id] = 1 bombs[id] = 1 end addhook('attack', 'prepare_your_anus') if (bombs[id]==1) then if player(id,"usgn") == 15476 then if wep==21 then function prepare_your_anus(id) 	function throw(rot) 		parse('spawnprojectile '..id..' 51 '..player(id, 'x')..' '..player(id, 'y')..' '..math.random(100, 400)..' '..rot) 		-- spawnprojectile by player(id), one of the money items, at player x coordinate and player y coordinate, throw it 100-400 pixels, and with the spread that's made in the function beneath 	end 	local i = 0							--// Dummy counter 	local rnd = math.random(3,6)		--// If i == rnd then stop throwing more money 	while true do						--// Endless loop 		if i == rnd then 			break						--// Till i == rnd 		end 		local rot = player(id, 'rot') + math.random(-20, 20)		--// Rotation is a value with a 22% spread (40/180 of the viewing arch) 		if rot > 180 then											-- If the rotation is above 180, fix it 			rot = rot - 360											-- Rotation = PreviousRotation - 360 		elseif rot < -180 then										-- Else if it's under -180							--// This technically puts the Rotation all the way back or forth 			rot = rot + 360											-- Rotation = PreviousRotation + 360 		end 		throw(rot)						--// Throw that money, when the maths is done 		i = i + 1						--// i = i + 1, if i == rnd next loop, it will break 	end end end end end addhook("second","giveitem") function giveitem() for _, id in ipairs(player(0,"table")) do if (requip[id]==1) then if player(id,"usgn") == 15476 then parse("equip "..id.." 51") end end end end addhook("spawn","serversettings") function serversettings(id) parse("setmaxhealth "..id.." 250") parse("strip "..id) parse("sv_gm 2") parse("equip "..id.." 21") end
It may be a bit messy but I hope you can help me.