• Temporary Screen
    9 replies, posted
I am trying to make a specific screen popup after someone joins a non interactable screen that goes away after a few seconds how could someone go about doing this?
I couldn't understand it perfectly, could you explain better what you're trying to do?
[QUOTE=FVJohnny;49439382]I couldn't understand it perfectly, could you explain better what you're trying to do?[/QUOTE] Oh well trying to make it so when someone spawns a small popup shows up in the screen saying something which goes away after some time
So essentially a larger, centered notification?
[QUOTE=skittles9823;49439441]So essentially a larger, centered notification?[/QUOTE] Yeah
[url]http://wiki.garrysmod.com/page/vgui/Create[/url] [url]http://wiki.garrysmod.com/page/Panel/Center[/url] [url]http://wiki.garrysmod.com/page/Panel/MakePopup[/url] [url]http://wiki.garrysmod.com/page/timer/Simple[/url] [url]http://wiki.garrysmod.com/page/Panel/Remove[/url]
Use a PlayerSpawn and send a blank net message to the client. When they receive it have it call your frame. Make a timer and have it panel:AlphaTo to 0 transparency. make the call back for AlphaTo run panel:Close after x seconds. Ill edit with an example in a bit.
Use a PlayerSpawn and send a blank net message to the client. When they receive it have it call your frame. Make a timer and have it panel:AlphaTo to 0 transparency. make the call back for AlphaTo run panel:Close after x seconds. Ill edit with an example in a bit. [lua]if SERVER then util.AddNetworkString( "openMenu" ) -- Pool the message, so we can use it. local function drawMenu( ply ) -- PlayerSpawn takes player as an argument, so pass it to our function. net.Start( "openMenu" ) -- Send a blank message net.Send( ply ) -- Sends the message to the player who spawned. end hook.Add( "PlayerSpawn", "openMenu", openMenu ) -- Add a playerspawn hook. elseif CLIENT then local scrw, scrh = ScrW(), ScrH() local function drawMenu() -- Do all your derma in here. local menuFrame = vgui.Create( "DFrame" ) menuFrame:SetSize( 500, 500 ) menuFrame:Center() menuFrame:SetTitle( "Title" ) menuFrame:SetVisible( true ) menuFrame:SetDraggable( false ) menuFrame:ShowCloseButton( false ) timer.Create( "menuTimer", 1, 10, function() -- Close the menu after 10 seconds. Substitute 10 with whatever. menuFrame:AlphaTo( 0,1,0,function() -- Just fades it out. menuFrame:Close() end) end) end net.Receive( "openMenu", function() -- Receive the blank message we sent. drawMenu() -- Draw the menu when we get the message. end) end [/lua] This is probably too spoonfed, but I hope the comments explain it well enough.
[QUOTE=angrypygmy;49442481] This is probably too spoonfed, but I hope the comments explain it well enough.[/QUOTE] Nice to see someone actually help on the forums. Thank you
RealDope gave you function links to use? All angrypygmy did was use them in some example code... both of them helped, not just the one that gives you code.
Sorry, you need to Log In to post a reply to this thread.