Im trying to make a panel that stores a name using DTextEntry but it won’t let me type is there a way to disable player movement as well as make it so player doesn’t spawn till the name is entered?
Did you call MakePopup on the frame?
Also if you remove any way of closing the window, except for entering a name, that should do it.
i have it parented to a DPanel would MakePopup work still?
I remember I made something similar, give me a second and I’ll give you an example code.
local pnlEntry = vgui.Create(“DTextEntry”, pnl)
pnlEntry.OnGetFocus = function()
if pnlEntry:GetText() == “Name…” then
pnlEntry.OnEnter = function(self)
– change name code here
if you parent it to a DFrame and do DFrame:MakePopup() it will take care of capturing the mouse/keyboard input for you
You might also like to look at these:
This code centers the frame on the player’s screen:
–set the size here FIRST with SetSize(x,y)
DFrame:SetPos(ScrW() / 2 - DFrame:GetWide() / 2, ScrH() / 2 - DFrame:GetTall() / 2)