Forum
Scripts
Object Destroy
Object Destroy
20 replies
clientdata and
reqcld to find the position of the mouse and then just do whatever you want after you have found the data. For example, check if a certain object is located in where the pointer is being held and then destroy it. function destroy()
if object(id,'exists') then
?? Destroy ???
killobject?And also you might make use of
object.
serveraction hook.
edited 2×, last 29.05.19 10:33:28 am
Danilwra: tabbed and fixed1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
addhook("serveraction","serveraction_")
addhook("clientdata","clientdata_")
function serveraction_(id,act)
	if act==3 then --this is where you made a mistake
		reqcld(id,2)
	end
end
function clientdata_(id,mode,x,y)
	if mode==2 then
		parse("explosion "..x.." "..y.." 20 999999")
	end
end
1
parse("explosion "..x.." "..y.." 20 999999")
gamus: are you stupid or what? Admin/mod comment
§5.1 - Show good behavior and simply don't be a stupid asshole
edited 1×, last 29.05.19 10:33:14 am
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
addhook("always", "_always")
addhook("clientdata", "_clientdata")
addhook("serveraction", "_serveraction")
local mouses = {}
function _always()
reqcld(0, 2)
end
function _clientdata(id, mode, data1, data2)
if mode == 2 then
mouses[id] = {data1, data2}
end
end
function _serveraction(id, action)
if (action == 2) then
local objectID = objectat(math.floor(mouses[id][1] / 32 + 0.5), math.floor(mouses[id][2] / 32 + 0.5))
if (objectID > 0) then
parse("killobject " .. objectID)
end
end
end
edited 1×, last 29.05.19 10:32:44 am
edited 1×, last 29.05.19 10:33:07 am
edited 1×, last 29.05.19 10:33:47 am
1 
Offline