• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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