Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Attempt to reach GUI through Workspace, not working?

Asked by
bloxxyz 274 Moderation Voter
10 years ago

This is not working. I understand it's repetitive, but I just learned how to do this and I cannot do it right no matter what I try. Can anyone help? Thank you!

game.Players.PlayerAdded:connect(function(plr) -- Put this script in workspace
wait(3)
print("Player Has Entered Server")  -- Every time a player's entered this prints.
plr:WaitForDataReady("StarterGui").INTRO.IS.Visible = true
wait(3) 
plr:WaitForDataReady("StarterGui").INTRO.IS.Visible = false
plr:WaitForDataReady("StarterGui").INTRO.QFA.Visible = true 
wait(3) 
plr:WaitForDataReady("StarterGui").INTRO.IS.Visible = true 
wait(3) 
plr:WaitForDataReady("StarterGui").INTRO.IS.Visible = false

end)
0
Wait, I did a script exactly like this, wierd. HexC3D 830 — 10y
0
Part of this script is from my old answer espacially the part "Put this in workspace" part, I remeber HexC3D 830 — 10y
0
Remember* HexC3D 830 — 10y
0
So? People reuse code. That's what this site is for. MrFlimsy 345 — 10y
0
I know, I also might know the problem to this question too. HexC3D 830 — 10y

2 answers

Log in to vote
2
Answered by
MrFlimsy 345 Moderation Voter
10 years ago

The WaitForDataReady() function is for DataPersistence, which is a semi-outdated service for storing player data. This is not likely what you're trying to access. StarterGui is the service used for cloning GUIs into players when they join. If you want to edit a player's GUI after they have joined, you should edit the GUI in their PlayerGui. Here is the fixed code:

game.Players.PlayerAdded:connect(function(plr) -- Put this script in workspace
wait(3)
print("Player Has Entered Server")  -- Every time a player's entered this prints.
plr.PlayerGui.INTRO.IS.Visible = true
wait(3) 
plr.PlayerGui.INTRO.IS.Visible = false
plr.PlayerGui.INTRO.QFA.Visible = true 
wait(3) 
plr.PlayerGui.INTRO.IS.Visible = true 
wait(3) 
plr.PlayerGui.INTRO.IS.Visible = false

end)
0
WaitForDataReady Is still useful , I remeber answering a question like this because part of the question is from some old answer of mine. HexC3D 830 — 10y
0
I don't realize why this keeps getting downvoted. I'm explaining why the original script went wrong, as well as providing a fixed version. MrFlimsy 345 — 10y
0
Thank you. It's working great now. +1 Rep and Accepted Answer :) bloxxyz 274 — 10y
Ad
Log in to vote
2
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
10 years ago

It's their PlayerGui, not StarterGui.

game.Players.PlayerAdded:connect(function(plr) -- Put this script in workspace
wait(3)
print("Player Has Entered Server")  -- Every time a player's entered this prints.
repeat wait() until plr:findFirstChild("PlayerGui")
plr.PlayerGui.INTRO.IS.Visible = true
wait(3) 
plr.PlayerGui.INTRO.IS.Visible = false
plr.PlayerGui.INTRO.QFA.Visible = true 
wait(3) 
plr.PlayerGui.INTRO.IS.Visible = true 
wait(3) 
plr.PlayerGui.INTRO.IS.Visible = false

end)

0
@Whoever bumped me back up, I appreciate it. Shawnyg 4330 — 10y
0
Why are you minused, something tells me someone made the mistake of using 'StarterGui' and then minused you. HexC3D 830 — 10y
0
MrFlimsy had more detail, but I gave you +1 rep for the help :D bloxxyz 274 — 10y
0
Thank you anyways. @Hec, Probably. Shawnyg 4330 — 10y

Answer this question