• DarkRP Derma Button Problem
    5 replies, posted
I am having this problem with my Derma Button For my f4 menu It wont stay in the f4 menu. When you open the f4 menu the buttons will show up, but when you close it they dont go away i have screen shot[IMG]http://imgur.com/gqkvM8X[/IMG][IMG]http://imgur.com/WrceuyD[/IMG] those are the 2 pics on what keeps happening and what it looks like, Can someone please help me. Also here is the script function GM:Supporterinfo() local DermaButton = vgui.Create( "DButton" ) DermaButton:SetParent(SupporterinfoTab) -- Set parent to our "DermaPanel" DermaButton:SetText( "Click To Buy Supporter $15" ) DermaButton:SetPos( 330, 145) DermaButton:SetSize( 150, 80 ) DermaButton.DoClick = function () RunConsoleCommand( "ulx asay Tryed To Click Buy Supporter" ) -- What happens when you press the button end local DermaButton = vgui.Create( "DButton" ) DermaButton:SetParent(SupporterinfoTab) -- Set parent to our "DermaPanel" DermaButton:SetText( "Click To Buy Admin $6" ) DermaButton:SetPos( 820, 145) DermaButton:SetSize( 150, 80 ) DermaButton.DoClick = function () RunConsoleCommand( "ulx asay Tryed To Click Buy Supporter" ) -- What happens when you press the button end local SupporterinfoTab = vgui.Create("DPanelList") SupporterinfoTab:EnableVerticalScrollbar( true ) function SupporterinfoTab:Update() self:Clear(true) local donator = vgui.Create("DLabel", SupporterinfoTab) donator:SetText("To buy supporter it will cost $15, When you buy supporter it will be permanent. The benefits of supporter are More Jobs, and More Printers.") donator:SizeToContents() end SupporterinfoTab:Update() return SupporterinfoTab end
If you have a custom close button add this in the doclick function. [lua] if IsValid(DermaButton ) then DermaButton:Close() -- Or Remove I don't remember end [/lua]
I did it and i get the error [ERROR] gamemodes/darkrp/gamemode/client/showteamtabs.lua:1041: attempt to call method 'Close' (a nil value) 1. DoClick - gamemodes/darkrp/gamemode/client/showteamtabs.lua:1041 2. unknown - lua/vgui/dlabel.lua:206 And to make sure if i did it right local DermaButton = vgui.Create( "DButton" ) DermaButton:SetParent(SupporterinfoTab) -- Set parent to our "DermaPanel" DermaButton:SetText( "Click To Buy Supporter $15" ) DermaButton:SetPos( 330, 145) DermaButton:SetSize( 150, 80 ) DermaButton.DoClick = function () if IsValid(DermaButton ) then DermaButton:Close() -- Or Remove I don't remember end RunConsoleCommand( "ulx asay Tryed To Click Buy Supporter" ) -- What happens when you press the button end local DermaButton = vgui.Create( "DButton" ) DermaButton:SetParent(SupporterinfoTab) -- Set parent to our "DermaPanel" DermaButton:SetText( "Click To Buy Admin $6" ) DermaButton:SetPos( 820, 145) DermaButton:SetSize( 150, 80 ) DermaButton.DoClick = function () if IsValid(DermaButton ) then DermaButton:Close() -- Or Remove I don't remember end RunConsoleCommand( "ulx asay Tryed To Click Buy Supporter" ) -- What happens when you press the button end thats how i set it up
Change the Close to Remove, like his comment says.
use lua tags too [ lua][ /lua]
I did that and it still stays on my screen and it wont go infront of the f4 menu
Sorry, you need to Log In to post a reply to this thread.