Hi i've been tinkering with Chris's script he posted on forums, i edited the script with a new GUI but it's not opening.. I have no Errors come up everything seems to be in good working order but soon as i press R doesn't work, it doesn't work. Then i decided to add Chris's script Non-Edited and it still never worked...
Script:
NPC Code:
//#CLIENTSIDE
function onCreated()
{
show();
}
function onKeyPressed( code, key )
{
if ( key == "r" )
{
setTimer( 0.05 );
Pez_Window2.visible = Pez_Window2.visible - 1;
GraalControl.makeFirstResponder( true );
}
}
function onWeaponFired()
{
say2( "Press 'r' to toggle Music Player" );
}
function show()
{
playing = this.playing;
Pez_Window2.destroy();
new GuiWindowCtrl( "Pez_Window2" )
{
profile = "GuiBlueWindowProfile";
width = 280;
height = 120;
x = screenwidth - width;
y = screenheight - height;
canClose = canMinimize = true;
canMaximize = canResize = false;
visible = false;
text = "Music Player for" SPC servername;
useownprofile = true;
profile.transparency = .9;
new GuiMLTextCtrl( "Pez_Text1" )
{
profile = "GuiBlueTextProfile";
x = 10;
y = 30;
width = 270;
height = 20;
useownprofile = true;
profile.align = "center";
text = "<center>Now playing:" SPC playing;
}
new GuiPopUpMenuCtrl( "Pez_Popup1" )
{
profile = "GuiBluePopUpMenuProfile";
width = 260;
height = 20;
x = 10;
y = 50;
textprofile = "GuiBlueTextListProfile";
scrollprofile = "GuiBlueScrollProfile";
clearRows();
temp.music = {
{ "SONG_NAME", "SONG_URL" },
{ "SONG2_NAME", "SONG2_URL" }
};
for ( temp.i = 0; temp.i < temp.music.size(); temp.i ++ )
{
with( addRow( 0, temp.music[temp.i][0] ) )
{
this.var = temp.music[temp.i][1];
}
}
setSelectedRow( 0 );
sort();
}
new GuiButtonCtrl( "Pez_Button1" )
{
profile = "GuiBlueButtonProfile";
width = 75;
height = 30;
x = Pez_Window2.width / 2 - ( width / 2 );
y = Pez_Window2.height - 40;
text = "Stop Music";
}
}
stopmidi();
this.playing = "[None]";
Pez_Text1 = "Now playing: [None]";
}
function onTimeOut()
{
this.time += .05;;
setTimer( 0.05 );
}
function Pez_Button1.onAction()
{
stopmidi();
this.playing = "[None]";
Pez_Text1 = "Now playing: [None]";
}
function Pez_Popup1.onSelect()
{
if ( this.time > 0 )
{
this.playing = params[1];
Pez_Text1.text = "Now playing:" SPC params[1];
play( Pez_Pupup1.rows[params[2]].var );
}
}
function onPlay( title, song )
{
this.playing = title;
Jukebox_Text.text = "Now playing:" SPC title;
play( song );
}
Anybody know what's wrong? Help would be appretiated.