Title explains it all. I am working on a script, all is going well, except I need a way for the UI to open on InitialSpawn, however after they press a “submit” button, it will no longer ever appear.
GM:OnEntityCreated, check to make sure the entity created is
LocalPlayer, and open the gui in there. Then, just make a submit button that closes the gui. Then at the end of the hook make sure you use
hook.Remove because you won’t need the hook anymore.
How would I go about making sure the entity created is LocalPlayer
You might want to first look through some basic tutorials on lua syntax here. As for your question, use an ‘if’ statement.
And using OnEntityCreated will only make it work on the absolute first join to the server?
Didn’t you create a thread just like this? If you go back there is 1000 pages explaining to you how to do so–.
I created a thread about creating a naming system - It all works fine, now I need a reliable way of checking if a player has a name and if they don’t have one, it will open the gui.
I wouldn’t have said it if it didn’t…
just check if pdata exists?
if (ply:GetPData("name")) then do ur shit end
function show_ui() if LocalPlayer():GetPData("UI_showed") then return end -- the ui/frame code goes here function my_frame:OnClose() LocalPlayer():SetPData("UI_showed", true) end end