Play Music For Player

ryerye1996

Cool Member
Reaction score
5
I'm Pretty New to Jass and i have no idea why this isnt working... any1 know why??? (+rep)
I am trying to make 1 player play the music (Lumbridge).

JASS:
function Trig_Lumbridge_Func005C takes nothing returns boolean
    if ( ( GetUnitTypeId(GetEnteringUnit()) == 'H007' ) ) then
        return true
    endif
    if ( ( GetUnitTypeId(GetEnteringUnit()) == 'H008' ) ) then
        return true
    endif
    if ( ( GetUnitTypeId(GetEnteringUnit()) == 'H000' ) ) then
        return true
    endif
    return false
endfunction

function Trig_Lumbridge_Conditions takes nothing returns boolean
    if ( not Trig_Lumbridge_Func005C() ) then
        return false
    endif
    return true
endfunction

function Trig_Lumbridge_Actions takes nothing returns nothing
    set udg_Player = GetPlayerColor(GetOwningPlayer(GetEnteringUnit()))
    (if ((GetLocalPlayer == udg_Player) then))
    call PlayMusicBJ( gg_snd_Lumbridge )
    endif
endfunction

//===========================================================================
function InitTrig_Lumbridge takes nothing returns nothing
    set gg_trg_Lumbridge = CreateTrigger(  )
    call TriggerRegisterEnterRectSimple( gg_trg_Lumbridge, gg_rct_Music_Lumbridge )
    call TriggerAddCondition( gg_trg_Lumbridge, Condition( function Trig_Lumbridge_Conditions ) )
    call TriggerAddAction( gg_trg_Lumbridge, function Trig_Lumbridge_Actions )
endfunction
 

BlackRose

Forum User
Reaction score
239
That is not JASS, that is just converted GUI with a LocalPlayer thing.

First, what is the problem? It isn't working? what isn'it working? Music is not playing? It is only playing for 1 player? ???? More details please.

But:

Why do you need color? Why not just GetOwningPlayer( GetTriggeringUnit() ).

It might be the problem with the music, if you play it outside the if, does it work?
Try stopping all music before playing it.
 

Romek

Super Moderator
Reaction score
964
> (if ((GetLocalPlayer == udg_Player) then))
if GetLocalPlayer() == udg_Player then

Bracket spam much?
 
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