Keyboard assign with sound. [SOLVED]

Started by , Thu 27/01/2005 10:52:29

Previous topic - Next topic

Magnus

Hi Forum...
This might by a little hard, but i'll give it a shot..

I need a script that tells your keyboard to play a sound
Fx:
If you push the "f" key it well play a sound from a piano

I'm not that good of a scripter, but i know its possible. So if any of you guys know how its done PLEASE tell...

thanks
Magnus

Gilbert

Just in the on_key_press() global script function add something like:
if (keycode=='A') PlaySound(5);
if (keycode=='B') PlaySound(6);
  .
  .
  .

Simple as that.
If you want that to happen only in a certain room, just create a on_key_press() in that room's room script, like:
function on_key_press(int keycode){
  if (keycode=='A') PlaySound(5);
  if (keycode=='B') PlaySound(6);
  .
  .
  .
}

Magnus


javascript:replaceText('%20;D',%20document.postmodify.message);
okay thats simple, thank you i'll try that....
peace!


Quote from: Gilbot V7000a on Thu 27/01/2005 11:08:06
Just in the on_key_press() global script function add something like:
if (keycode=='A') PlaySound(5);
if (keycode=='B') PlaySound(6);
Ã,  .
Ã,  .
Ã,  .

Simple as that.
If you want that to happen only in a certain room, just create a on_key_press() in that room's room script, like:
function on_key_press(int keycode){
Ã,  if (keycode=='A') PlaySound(5);
Ã,  if (keycode=='B') PlaySound(6);
Ã,  .
Ã,  .
Ã,  .
}


SMF spam blocked by CleanTalk