Problem with Script: Get Killing Unit

Status
Not open for further replies.
Level 7
Joined
Jul 1, 2008
Messages
1,023
Hi, I'm trying to get the game to play a sound specificaly for a player, I need it to play for the owner of the killing unit, im using costum script as directed but its not working.
The map tells me ive made an error and turns the trigger off :/
Here is my Trigger:

Gileneas is Conquered
  • Events
    • Unit - King of Gilneas 0256 <gen> Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Owner of (Killing unit)) Equal to Player 1 (Red)
          • (Owner of (Killing unit)) Equal to Player 4 (Purple)
          • (Owner of (Killing unit)) Equal to Player 5 (Yellow)
          • (Owner of (Killing unit)) Equal to Player 10 (Light Blue)
    • Actions
      • Trigger - Turn off (This trigger)
      • Wait 5.00 seconds
      • Custom script: if GetLocalPlayer() == GetOwningPlayer(GetKilling()) then
      • Sound - Play QuestCompleted <gen>
      • Custom script: endif
      • Unit - Remove (Triggering unit) from the game
pls help
 
Thank you for the quick replies, I can't say I'm having any more luck with this, I tried your trigger Pharoh but I'm still getting an error, is there anyone wrong with this still?

  • Gileneas is Conquered
  • Gileneas is Conquered
    • Events
      • Unit - King of Gilneas 0256 <gen> Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Owner of (Killing unit)) Equal to Player 1 (Red)
          • (Owner of (Killing unit)) Equal to Player 4 (Purple)
          • (Owner of (Killing unit)) Equal to Player 5 (Yellow)
          • (Owner of (Killing unit)) Equal to Player 10 (Light Blue)
    • Actions
      • Trigger - Turn off (This trigger)
      • Set killingunit = (Killing unit)
      • Wait 5.00 seconds
      • Custom script: if GetLocalPlayer() == GetOwningPlayer(udg_Killingunit) then
      • Sound - Play QuestCompleted <gen>
      • Custom script: endif
      • Unit - Remove (Triggering unit) from the game
 
  • Gileneas is Conquered
    • Events
      • Unit - King of Gilneas 0256 <gen> Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Owner of (Killing unit)) Equal to Player 1 (Red)
          • (Owner of (Killing unit)) Equal to Player 4 (Purple)
          • (Owner of (Killing unit)) Equal to Player 5 (Yellow)
          • (Owner of (Killing unit)) Equal to Player 10 (Light Blue)
    • Actions
      • Trigger - Turn off (This trigger)
      • Set killingunit = (Killing unit)
      • Wait 5.00 seconds
      • Custom script: if GetLocalPlayer() == GetOwningPlayer(udg_killingunit) then
      • Sound - Play QuestCompleted <gen>
      • Custom script: endif
      • Unit - Remove (Triggering unit) from the game
Jass is key-sensitive, so if your variable is named 'killingunit' you have to consider writing it's exact name: 'udg_killingunit', not 'udg_Killingunit'. ;)
 
Status
Not open for further replies.
Back
Top