I have some code:
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
addhook("use", "my.hook.use")
function my.hook.use(id,event,x,y)
	if event==100 then
		if player(id,"tilex")==x and player(id,"tiley")==y then
			msg('[DEBUG] [Use] player: '..player(id,"name")..' event: '..event..' x: '..x..' y: '..y)
		end
	end
end
because X = 0 and Y = tilex wtf
okay, corrected it on:
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
addhook("use", "my.hook.use")
function my.hook.use(id,event,x,y)
	if event==100 then
		if player(id,"tilex")==y then
			msg('[DEBUG] [Use] player: '..player(id,"name")..' event: '..event..' x: '..x..' y: '..y)
		end
	end
end
but all is not well, sometimes the action is performed for another player.
where is the mistake?
Use hook, null value
1 
Offline
Nekomata
Edit: Hmm... Looks like you filled up the trigger field with debug instead of the name in the map editor. That must be done the opposite otherwise it's quite obvious it will not recognize the trigger because it has no name therefore a nil value.