[Simple] how to play a sound with text

R 3 T R O

New Member
Reaction score
12
Okay. So i got like 100000's of
JASS:
Game - Display to (All players) the text
and with each of them is a sound. I want to know is there an easier way of doing this for ex.

JASS:
function GeneralText takes string message returns nothing
    call DisplayTextToForce(GetPlayersAll(),message)
    call PlaySoundBJ( gg_snd_Beep )
endfunction


but that didnt seem to work. Im not good at jass so it was an attempt
 

Executor

I see you
Reaction score
57
JASS:
library GeneralText initializer Init

globals
    private sound snd
endglobals

function GeneralText takes string message returns nothing
    call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, message)
    call StartSound(snd)
endfunction

private function Init takes nothing returns nothing
    set snd = CreateSoundFromLabel("SecretFound",false,false,false,10,10)
endfunction

endlibrary


Trigger:
  • Custom script: call GeneralText( "yourtext" )


"SecretFound" equals SecretFound.wav of the sound editor in the category Interface.
 

Laiev

Hey Listen!!
Reaction score
188
Not sure but i think in this case [ljass]GetLocalPlayer()[/ljass] will cause desync
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top