Error with message passing to another script

In my game i would like the enemy script to send a message to the player script to say that the player has been hit so i can update the lives gui and play an animation but it wont pass the message?

	msg.post("player:/player#player_script", "player_hit")


This is the code for the player

	if message_id == hash("player_hit") then
		print("player hit")
	end

For reference this is the properties of the player script to show the file path:
image

You’re likely getting your URLs wrong. Read this manual:

A quick way to check the URL of a script is to put this in init():

print(msg.url())
2 Likes