• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[JASS] Is this Jass correct?

Status
Not open for further replies.
Level 5
Joined
Aug 15, 2007
Messages
145
As in will it work??

JASS:
call CreateUnitAtLoc (GetOwningPlayer(GetSpellAbilityUnit()),  'h00O', udg_LocPoint3, AngleBetweenPoints(udg_LocPoint1, udg_LocPoint2)) returns unit
    local unit u = CreateUnitAtLoc( (GetOwningPlayer(GetSpellAbilityUnit()),  'h00O', udg_LocPoint3, AngleBetweenPoints(udg_LocPoint1, udg_LocPoint2)) returns unit
    call UnitApplyTimedLife(u,  'BTLF', 3.00)
    call RemoveLocation( udg_LocPoint1 )
 
Level 5
Joined
Dec 18, 2007
Messages
205
you must skip the return things at the end of the line, they are just an information for you what type will be returned or whether there will be returned nothing. this means you can't set a variable to a function that returns nothing.

cleaned code:

JASS:
    local unit u = CreateUnitAtLoc(GetOwningPlayer(GetSpellAbilityUnit()), 'h00O', udg_LocPoint3, AngleBetweenPoints(udg_LocPoint1, udg_LocPoint2))
    call UnitApplyTimedLife(u, 'BTLF', 3.00)
    call RemoveLocation(udg_LocPoint1)
    //if loc 2 and 3 are not static:
    call RemoveLocation(udg_LocPoint2)
    call RemoveLocation(udg_LocPoint3)
 
Status
Not open for further replies.
Top