1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
addhook("drop","ondrop")
function drop(id,iid,type)
if player(id,"team")==2 then
if type==51 then
parse('hudtxt2 '..id..' 0 "" 290 205 0')
end
end
end
Scripts
Drop hook
Drop hook
1

addhook("drop","ondrop")
function drop(id,iid,type)
if player(id,"team")==2 then
if type==51 then
parse('hudtxt2 '..id..' 0 "" 290 205 0')
end
end
end
addhook("drop","ondrop")
function ondrop(id,iid,type) --You need to name it like you named it on the hook
	if player(id,"team")==2 then
		if type==51 then
			parse('hudtxt2 '..id..' 0 "your text" 290 205 0')
		end
	end
end
You didn't enter a message in the HUDTXT command
You didn't name the function properly
Also consider tabbing your code like I did it only makes it easier
drop is reserved thus you're not able to use it as a function identifier. ondrop at contrary is the function name that you should use for your function! I hope this is what you're referring about.
Edit 1: Got ninja'd.
GeoB99: There's no
drop identifier at all. It's not a reserved word so you can use it as the function's name.
Mami Tomoe: I believe that you can show an empty HUD text.attempt to call a nil valueerror. Please remember this when you're making a function for a hook: you need to make sure that the function's name in the
addhookand declaration of the function are the same.
addhook("<hook>", "<function>")
function <function>(...)
	...
end
Dousea has written
Mami Tomoe: I believe that you can show an empty HUD text.
1
