Function only run once ?

How can I make my function only activate 1 time, or something if the panel already exists then return end ?

Well you can try something like this:

timer.Create(“unknown_timer”, 1, 1, function(ply)
– code

The “unknown_timer” is the name. the first one, is how long it takes to activate the code, and the second 1, is how many times to run it. (0 is infinite)
Also, don’t know if this was what you were looking for.

Was hoping for something like if my DFrame already exists a new one won’t be created.

[lua]local frame
local function SomeFunction()
if frame then return end

--frame = vgui.Create"DFrame" or something