dev_Typ
(Typ)
December 22, 2022, 12:37am
1
Code:
script.Parent.Triggered:Connect(function(player)
local c = game:GetService("ServerStorage").GUIs:WaitForChild("MissionsPrompt"):Clone()
c.Parent = player.PlayerGui
c.Script.Enabled = true
print(c.Parent)
end)
For some reason, I cannot see the ScreenGui. When I run the print, it says 'PlayerGui'
, yet I do not see it there.
Obviously, this is a ServerScript (via ProximityPrompt)
azqjanna
(azqjanna)
December 22, 2022, 12:39am
2
Have you made sure that WaitForChild is actually returning? It will wait forever if the child is not there.
dev_Typ
(Typ)
December 22, 2022, 12:40am
3
It definitely is as the PRINT works and I am getting no other output
azqjanna
(azqjanna)
December 22, 2022, 12:41am
4
Is the gui Enabled and are its children all Visible?
dev_Typ
(Typ)
December 22, 2022, 12:41am
5
yes
thingthingthingthingthing11
azqjanna
(azqjanna)
December 22, 2022, 12:43am
6
Have you checked that player.PlayerGui is not nil before using it to set the parent?
dev_Typ
(Typ)
December 22, 2022, 12:45am
7
well, it is printing so I assume it is not nil…
dev_Typ
(Typ)
December 22, 2022, 12:46am
8
either way, I just printed player.Name
and it returned correctly.
azqjanna
(azqjanna)
December 22, 2022, 12:48am
9
c.Parent = player.PlayerGui
is perfectly legal even if PlayerGui is nil at the time, it will not error. You should probably use WaitForChild() here as well just to be sure.
dev_Typ
(Typ)
December 22, 2022, 12:49am
10
Just tried that, it did not work.
azqjanna
(azqjanna)
December 22, 2022, 12:51am
11
You’ll have to run it and check what’s going on with the GUI after it gets inserted in Explorer.
1 Like
The name of this instance sounds like it’s a frame.
local screengui = Instance.new('ScreenGui',player.PlayerGui)
local c = game:GetService("ServerStorage").GUIs:WaitForChild("MissionsPrompt"):Clone()
c.Parent = screengui
dev_Typ
(Typ)
December 22, 2022, 12:57am
13
Nope. It does not. I checked.
30
dev_Typ
(Typ)
December 22, 2022, 12:58am
14
it is 100% a screengui
i do not know why this is happening
1 Like
You are checking player gui right? And not starter gui? If you are, then sorry I don’t know how else I can help you.
dev_Typ
(Typ)
December 22, 2022, 1:22am
16
yeah, thats what im saying. IDK what the prob is
1 Like
dev_Typ
(Typ)
December 30, 2022, 7:46pm
17
Still cannot find the issue here. So sad
mroaan
(NightCode)
December 30, 2022, 7:48pm
18
While testing, check your playerGui if it actually has the UI, if it does it could only mean that your gui isnt enabled or nothing in it is visible.
dev_Typ
(Typ)
December 30, 2022, 7:50pm
19
I cannot believe I just made this mistake. I had a script in it preventing players from going too far from the part-to-interact so it kept destroying. hah, found the issue.
Thanks!
1 Like
mroaan
(NightCode)
December 30, 2022, 7:54pm
20
No problem, but please set my post as the solution since it helped you to know the problem, have a nice day!