Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Can any1 help me with this JASS Script?

Discussion in 'Triggers & Scripts' started by naitsirk, Oct 4, 2009.

  1. naitsirk

    naitsirk

    Joined:
    Jan 24, 2009
    Messages:
    570
    Resources:
    0
    Resources:
    0
    Hello... I am trying out the beggining JASS torturial and i made Everything in it but I get 1 error with it:

    Code (vJASS):
    function Function2 takes nothing returns string
        local string message = SomeFunction("Hello World")
     return message
    endfunction


    The error is on the Second line of the Function and it says:
    Cannot convert nothing into string.... I woud love to get some help here:)

    I will give you +rep if u help me:)
     
  2. aznricepuff

    aznricepuff

    Joined:
    Feb 22, 2006
    Messages:
    749
    Resources:
    4
    Maps:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    4
    Does
    SomeFunction
    return a string? If not, then you cannot set message to the return value of that function.
     
  3. naitsirk

    naitsirk

    Joined:
    Jan 24, 2009
    Messages:
    570
    Resources:
    0
    Resources:
    0
    thanks:) i'll give you +rep for that:)
     
  4. Adiktuz

    Adiktuz

    Joined:
    Oct 16, 2008
    Messages:
    9,674
    Resources:
    23
    Models:
    2
    Packs:
    1
    Maps:
    1
    Spells:
    16
    Tutorials:
    1
    JASS:
    2
    Resources:
    23
    remove the SomeFunction and the parentheses........

    Code (vJASS):
    function Function2 takes nothing returns string
        local string message = "Hello World"
     return message
    endfunction


    but I think you can just make it return "Hello World" though I'm unsure....
     
  5. naitsirk

    naitsirk

    Joined:
    Jan 24, 2009
    Messages:
    570
    Resources:
    0
    Resources:
    0
    ehm.... I am pritty sure i Fixed this so it works.... so:)
     
  6. YourNameHere

    YourNameHere

    Joined:
    Apr 29, 2007
    Messages:
    745
    Resources:
    4
    Maps:
    1
    Spells:
    2
    JASS:
    1
    Resources:
    4
    Yes, you can simply do this:
    Code (vJASS):
    function Function2 takes nothing returns string
        return "Hello World"
    endfunction
     
  7. naitsirk

    naitsirk

    Joined:
    Jan 24, 2009
    Messages:
    570
    Resources:
    0
    Resources:
    0
    well.... My script worked Fine for me so........-.- I maybe shoud use the Solved Button? and ask for an admin to Close this threat?
     
  8. PurplePoot

    PurplePoot

    Joined:
    Dec 14, 2005
    Messages:
    11,161
    Resources:
    3
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    Resources:
    3
    No point; we just let solved threads die. Most of the time people are kind enough to ignore them once they're solved anyways.
     
  9. naitsirk

    naitsirk

    Joined:
    Jan 24, 2009
    Messages:
    570
    Resources:
    0
    Resources:
    0
    OK:)