Finder Trouble

I want to write a script that opens a dialog box when my computer starts up that says hello. But I don’t now how to tell the script to run when the Finder launches. Please help me.

Using Script Editor, save the following as an application and then add it to the Login Items in System Preferences.

display dialog "Hello"

– Rob