gordonramp Posted February 14, 2010 Posted February 14, 2010 I'm wanting to have a sound play when the Player hits a key... I can't seem to get it to work. Is this the Lua? if KeyHit(KEY_Z)==1 then LoadSound('abstract::impact_metal12.wav') PlaySound(impact_metal12.wav,10,1,1) end Quote AMD Athlon x2 7750 2.7ghz, 6gb ddr2 ram, Galaxy9800GT 1gig ddr2 video card, Windows 7,64.
Rick Posted February 14, 2010 Posted February 14, 2010 You would have to store the return of LoadSound() into a variable and pass that to PlaySound as the first parameter. Quote
gordonramp Posted February 14, 2010 Author Posted February 14, 2010 That actually made perfect sense to me.. Thanks. sound1=LoadSound('abstract::impact_metal12.wav') if KeyHit(KEY_Z)==1 then PlaySound(sound1,1,1) end Quote AMD Athlon x2 7750 2.7ghz, 6gb ddr2 ram, Galaxy9800GT 1gig ddr2 video card, Windows 7,64.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.