1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
//Fry! 	on:use { 	if ((count_inrange("state",5,50)+count_inrange("state",4,50))>0){ 		if (getplayerweapon()==504){ 			process "frying",500; 			fry; 			alteritem 1,10; 		}else{ 			msg "I need fire and get pan in my hand to fry this!",3; 		} 	} }
But when I press the button to use the item (E), mensangem only appears if I'm near the fire. If I'm away from the fire the message is not shown.
Note: The ID of my pan is 504
Write the correct script and explain it please
Model: