• 🏆 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] Problem with the local?

Status
Not open for further replies.
Level 3
Joined
May 2, 2008
Messages
41
I can't figure out what I am doing wrong. I don't think it sets u to Last Created Unit for some reason

JASS:
    local unit u
    set udg_Unit = gg_unit_hfoo_0000
    call CreateUnit(GetOwningPlayer(udg_Unit),GetUnitTypeId(udg_Unit),GetUnitX(udg_Unit),(GetUnitY(udg_Unit) + 600),GetUnitFacing(udg_Unit))
    set u = GetLastCreatedUnit()
    call UnitAddAbilityBJ( 'Aloc', u )
    call SetUnitPositionLoc( GetTriggerUnit(), Location(GetUnitX(udg_Unit), ( GetUnitY(udg_Unit) + 600.00 )) )
    set u = null
 
Level 3
Joined
May 2, 2008
Messages
41
Nevermind

I fixed it. For some reason you can't use GetLastCreatedUnit() with CreateUnit()
 
Status
Not open for further replies.
Top