Adding sound to a unit.

LearningCode

New Member
Reaction score
24
How would I do this? o.0
Like, I want to play the sound StampedeHit1.wav on a unit when he is hit by the spell.

I looked through the natives and I don't know how to do it xD
 

LearningCode

New Member
Reaction score
24
I can't set a sound to a filename either xD

[lJASS]local sound s = "Abilities\\Spells\\Other\\Stampede\\StampedeHit1.wav"[/lJASS]

Fails =/
How would I go about this? =x
 

LearningCode

New Member
Reaction score
24
I tried.

Sound Editor > StampedeHit1.wav > Use as sound

Came out a Variable name of "StampedeHit1"

JASS:
local sound s = StampedeHit1
local unit u = GetFilterUnit()

set s = PlaySoundAtPointBJ(s, 100.00, GetUnitLoc(u), GetUnitFlyHeight(u))

set s = null
set u = null


Failed

JASS:
local sound s = udg_StampedeHit1
local unit u = GetFilterUnit()

set s = PlaySoundAtPointBJ(s, 100.00, GetUnitLoc(u), GetUnitFlyHeight(u))

set s = null
set u = null


Also failed



Undeclared Variable and Cannot convert nothing to sound
 

LearningCode

New Member
Reaction score
24
local sound s = gg_snd_StampedeHit1
local unit u = GetFilterUnit()
local location l = GetUnitLoc(u)

call PlaySoundAtPointBJ(s, 100.00, GetUnitLoc(u), GetUnitFlyHeight(u))

set s = null
set u = null
call RenoveLocation(l)
set l = null

Worked ._.

Thanks xD
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top