=RM=Mario Posted November 9, 2009 Share Posted November 9, 2009 Alright,so i made this script to when you enter area in the desert for a DM map music would play,But when i start resource music plays no matter where on the map im at,i want the music to play when you Enter the col shape and, for it to turn off when you leave it,but isn't working,Thanks for help in Advance DesertMusic = playSound("Music.ogg", true) setSoundVolume(music,0) col = createColRectangle (-33.328407287598, 2004.6947021484, 17.640625,50) function EnterDesert(theElement, matchingDimension ) if ( theElement == getLocalPlayer() ) then setSoundVolume(music,1) end end addEventHandler ( "onClientColShapeHit", col, EnterDesert) function LeaveDesert(theElement, matchingDimension) if ( theElement == getLocalPlayer() ) then setSoundVolume(music,0) end end addEventHandler("onClientColShapeLeave",col,LeaveDesert) Link to comment
subenji99 Posted November 9, 2009 Share Posted November 9, 2009 Must be some bug relating to a volume change before a single frame of sound has played - try either: 1. Using a Timer setTimer(setSoundVolume,50,1,music,0) 2. Pausing the sound instead setSoundPaused(DesertMusic,true) Link to comment
=RM=Mario Posted November 9, 2009 Author Share Posted November 9, 2009 Must be some bug relating to a volume change before a single frame of sound has played - try either:1. Using a Timer setTimer(setSoundVolume,50,1,music,0) 2. Pausing the sound instead setSoundPaused(DesertMusic,true) Didnt work Link to comment
subenji99 Posted November 9, 2009 Share Posted November 9, 2009 I'm assuming you tried the timer, and it just occurred to me what it'll be DesertMusic = playSound("Music.ogg", true) setSoundVolume(music,0) See a problem there? setSoundVolume(DesertMusic,0) Link to comment
=RM=Mario Posted November 9, 2009 Author Share Posted November 9, 2009 No,its doing same thing,music plays even tho im not inside col shape,if im outside it,its not sopose toplay music,but its playing the music anyways,i did what you told me Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now