Weapons Shake - Lua Script 
29 comments
This is the Weapons Shake script, this script makes your screen shake depending on the weapon you're shooting with.
_________________________


_________________________




_________________________








edited 4×, last 13.04.12 01:24:00 am

Comments
29 commentsLog in!
You need to log in to be able to write comments!Log in

hahha xd, this is very easy but good work
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
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
weapons_table_shake2 = {1,2,4,6}
weapons_table_shake3 = {3,5,21,23,32,38,39,74,88}
weapons_table_shake4 = {20,22,24,30,31,33,34,40,46,54,75,86}
weapons_table_shake5 = {10,11,35,36,37,45,47,49,51,52,53,69,72,73,76,77,78,85,87}
function contains(table, element)
for _, value in pairs(table) do
if value == element then
return true
end
end
return false
end
addhook("attack","attackshake")
function attackshake(id)
if contains(weapons_table_shake2,player(id,"weapon")) then
parse("shake "..id.." 2")
end
if contains(weapons_table_shake3,player(id,"weapon")) then
parse("shake "..id.." 3")
end
if contains(weapons_table_shake4,player(id,"weapon")) then
parse("shake "..id.." 4")
end
if contains(weapons_table_shake5,player(id,"weapon")) then
parse("shake "..id.." 5")
end
end
addhook("hit","hitshake")
function hitshake(id)
parse("shake "..id.." 3")
end
weapons_table_shake3 = {3,5,21,23,32,38,39,74,88}
weapons_table_shake4 = {20,22,24,30,31,33,34,40,46,54,75,86}
weapons_table_shake5 = {10,11,35,36,37,45,47,49,51,52,53,69,72,73,76,77,78,85,87}
function contains(table, element)
for _, value in pairs(table) do
if value == element then
return true
end
end
return false
end
addhook("attack","attackshake")
function attackshake(id)
if contains(weapons_table_shake2,player(id,"weapon")) then
parse("shake "..id.." 2")
end
if contains(weapons_table_shake3,player(id,"weapon")) then
parse("shake "..id.." 3")
end
if contains(weapons_table_shake4,player(id,"weapon")) then
parse("shake "..id.." 4")
end
if contains(weapons_table_shake5,player(id,"weapon")) then
parse("shake "..id.." 5")
end
end
addhook("hit","hitshake")
function hitshake(id)
parse("shake "..id.." 3")
end

awesome , but the weapons 90 (M134) , 91 (FN F2000) , dont shake , but i fixed the problem for my personal use
(i dont wanna upload again)
good work
Mechanolith: ,
EngiN33R: ,
Starkkz: ,
J4x:

good work




@Anderst, its the chainsaw... i am making some realistic skins for CS2D, changing the weapons and etc. (the weapons will be the same, but the design and the size will be different).
@Anperm, what's the explanation of the 3/5 stars? If you don't explain i will consider your vote as a kind of revenge rate...
P.S.: Thanks for all the positive ratings
P.S.: Thanks for all the positive ratings

FN_Linkin Park, your tutorial can help me more than Lee's, because i don't get the way that Lee explain...

I won't recommend u to read my tutorial, im not that good at lua, but this tut (made by Lee) can help http://www.phailed.me/2011/02/learn-lua-the-hard-way-tables/#desc