Intro screen

function IntroImage( msg )
       --Makin teh if, If the Value is 1 it will run teh intro, If not it will skip it.
       if( ply:GetField( "FirstTimeLogin" ) == 1 )then
         -- Making mah Panel
         IntroPanel = CreateBPanel( "", 600, 300, 350, 300 );
         IntroPanel:CanClose( false );
         IntroPanel:CanDrag( false );
         IntroPanel:SetBodyColor( Color( 255, 255, 255, 255 ) )
         --Setting the size n material
         surface.SetMaterial( Material( "ts2logo/ts2logo" ) );
         surface.SetDrawColor( 255, 255, 255, 80 );
         surface.DrawTexturedRect( self:GetWide() - 600, self:GetTall() - 300 );
         -- Dev timer
          timer.Simple( 5, print( LocalPlayer():Nick() .. ": Intro started.") )
         --Timers to start diffrent things.
          timer.Simple( 10, ply:PromptAccountMenu(), ply );
          timer.Simple( 10, RunConsoleCommand( "rp_intro", 0 ) )
          timer.Simple( 9, RunConsoleCommand( "play buttons/button1.wav" ) )
          --Bypass, Start the Charactermenu

usermessage.Hook( "II", IntroImage );

Gives this error.

TacoScript2\gamemode\cl_intro.lua:6: attempt to index global 'ply' (a nil value)

I tried changing it to self, localply and client. They all give the same error.

Learn Lua before attempting this?

Honestly, a lot of that syntax is so wrong.

Well after all of the time that you have been here I have never seen you make a post that has actually helped anyone so can you code any better than him?

Yes he can.

I think you’re confusing me with Cubar.

Check my post history, I have random spurs of helping people… sometimes.

Also overlooked it again, most of them can of course be custom functions, and I think you’re looking for [lua]LocalPlayer()[/lua]


As experienced as you might be now, you also started at the bottom. Cut the guy some slack.

And I beat his ass until he got better. These chinese kids don’t come cheap yknow.

Syntax for timers is wrong. Arguments in timers are like, function,arg1,arg2 ect… so:
[lua]timer.Simple( 5, print( LocalPlayer():Nick() … “: Intro started.”) )[/lua]
Would become:
[lua]timer.Simple( 5, print, LocalPlayer():Nick() … “: Intro started.” )[/lua]

This is because you send the functions variable which is later called with its arguments using unpack().