Play music

1346610

New Member
Reaction score
6
Hello guys i want to make commands like that in dota of "-music"

But problem is that it must play the music for the player who only typed it and not for all players.

Thx in advice ;)

Ah guys i got this but it doesnt work :( :

Trigger:
  • Music orc3
    • Events
      • Player - Player 1 (Red) types a chat message containing -music orc3 as An exact match
      • Player - Player 2 (Blue) types a chat message containing -music orc3 as An exact match
      • Player - Player 3 (Teal) types a chat message containing -music orc3 as An exact match
      • Player - Player 4 (Purple) types a chat message containing -music orc3 as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -music orc3 as An exact match
      • Player - Player 6 (Orange) types a chat message containing -music orc3 as An exact match
      • Player - Player 7 (Green) types a chat message containing -music orc3 as An exact match
      • Player - Player 8 (Pink) types a chat message containing -music orc3 as An exact match
      • Player - Player 9 (Gray) types a chat message containing -music orc3 as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -music orc3 as An exact match
    • Conditions
    • Actions
      • Player Group - Pick every player in (Player group((Triggering player))) and do (Actions)
        • Loop - Actions
          • Sound - Stop music After fading
          • Sound - Play Orc 3
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
Local player is something I'm still not familiar with, you should try learning jass
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
you still click with jass, u just read it different
 

Aserpent

New Member
Reaction score
2
Writing takes longer to learn, Clicking doesn't, but clicking still essentially makes Jass code, JASS code has more possibilities though, due to functions and such that can't be reached through GUI -- Anyway, I don't think one JASS trigger would be that hard...
 

Sim

Forum Administrator
Staff member
Reaction score
534
Code:
Custom script:    if GetLocalPlayer() == GetTriggerPlayer() then
Custom script:    call StopMusic(true)
Custom script:    call StartSound(gg_snd_Orc3)
Custom script:    endif 
Custom script:    call KillSoundWhenDone(gg_snd_Orc3)
 

1346610

New Member
Reaction score
6
Sim167816 said:
Custom script: if GetLocalPlayer() == GetTriggerPlayer() then
Custom script: call StopMusic(true)
Custom script: call StartSound(gg_snd_Orc3)
Custom script: endif
Custom script: call KillSoundWhenDone(gg_snd_Orc3)

Thank you it worked ;)
No it didnt :( i had disabled the trigger so i thought it worked,the map just does not start because the custom scripts must be wrong, however this is what i did

Trigger:
  • Music elf1
    • Events
      • Player - Player 1 (Red) types a chat message containing -music elf1 as An exact match
      • Player - Player 2 (Blue) types a chat message containing -music elf1 as An exact match
      • Player - Player 3 (Teal) types a chat message containing -music elf1 as An exact match
      • Player - Player 4 (Purple) types a chat message containing -music elf1 as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -music elf1 as An exact match
      • Player - Player 6 (Orange) types a chat message containing -music elf1 as An exact match
      • Player - Player 7 (Green) types a chat message containing -music elf1 as An exact match
      • Player - Player 8 (Pink) types a chat message containing -music elf1 as An exact match
      • Player - Player 9 (Gray) types a chat message containing -music elf1 as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -music elf1 as An exact match
    • Conditions
    • Actions
      • Custom script: if GetLocalPlayer() == GetTriggerPlayer() then
      • Custom script: call StopMusic(true)
      • Custom script: call StartSound(Night Elf 1)
      • Custom script: endif
      • Custom script: call KillSoundWhenDone(Night Elf 1)
 

Sim

Forum Administrator
Staff member
Reaction score
534
> Custom script: call KillSoundWhenDone(Night Elf 1)

Custom script code uses a different name for variables. It adds "gg_snd_" as a prefix to the variable name, and if you don't add it, will not recognize it as a global sound variable.

What GFreak45 said should work.

Set NightElf music = Night Elf 1
and then use it that way
Custom script: call StartSound(udg_NightElf)
Custom script: endif
Custom script: call KillSoundWhenDone(udg_NightElf)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top