[SOLVED..cuz I'm stupid] Wtf is wrong with this script!! I must be missing something REALLY obvious!

I’m not a total noob at programming! I shouldn’t have to come to the forums for a problem in a script this simple, but seriously…wtf is wrong!!!

public class NoteScript extends MonoBehaviour
{
    public var text : String;
    private var greetingText : float;
    greetingText = Random.Range(0,5);
    if (greetingText == 0.0)
    {
        text = "What's on you mind?";
    }
    else if (greetingText == 1.0)
    {
        text = "Need to remember something?";
    }
    else if (greetingText == 2.0)
    {
        text = "I make a great To-Do List!";
    }
    else if (greetingText == 3.0)
    {
        text = "Null Reference Exception: ...Just kidding, this script works perfectly :)";
    }
    else if (greetingText == 4.0)
    {
        text = "I can't think of any other default notes that won't be annoying. Click on me to type.";
    }
    else
    {
        text = "Type your notes here.";
    }
}

I had to put it in a function…someone shoot me in the head for being so dumb lol

1 Like

lol

i usually forget to put the void part in or forget i’m in Csharp and writing the functions in java script

1 Like