• [LUA Scripting Issue] Closing derma menu not using a button.
    7 replies, posted
Hello there! I managed to open a menu about the information of a player when you look at him and press E. I would like to know how to close it, when you stop looking at him or when you go too far. I have the Distance value. Thanks if you awnser.
DermaPanel:Close()
[QUOTE=Science;40614172]DermaPanel:Close()[/QUOTE] I know that, but I don't know in what kind of function I have to put this.
[QUOTE=AlbertoBC;40614175]I know that, but I don't know in what kind of script I have to put this.[/QUOTE] [lua] btn.DoClick = function() Frame:Close() // If you are using a frame or Panel:Remove() // If you are suing a panel end [/lua]
[QUOTE=BoowmanTech;40614188][lua] btn.DoClick = function() Frame:Close() // If you are using a frame or Panel:Remove() // If you are suing a panel end [/lua][/QUOTE] But Im not looking to close it with a button, Im looking to close it when you stop looking at the player. Because it's a menu with the info of the player that you're looking at.
When you open it said a variable eg. ViewingPly = Entity [lua] hook.Add("Think","", function() local tr = LocalPlayer():GetEyeTrace() if tr.Entity != ViewingPly or tr.HitWorld then ViewingPly = nil Derma:Close() end end) [/lua] Typing from my phone so that's general. Don't forget to put failsafes in.
[lua] DFrame.Think = function() end [/lua] The above is better as it only 'thinking' when the menu is open.
[QUOTE=Aide;40614427][lua] DFrame.Think = function() end [/lua] The above is better as it only 'thinking' when the menu is open.[/QUOTE] I will try it! Many thanks!!!!! [editline]12th May 2013[/editline] Solved, thanks to everyone for trying to help. And thanks to Aide, for giving me the solution :)
Sorry, you need to Log In to post a reply to this thread.