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

[SOLVED] Why is GUI is not a valid member of PlayerGui?

Asked by 7 years ago
Edited 7 years ago

The script in ServerScriptService and FilteringEnabled is on.

Part of script:

01function playerEnter(newPlayer)
02    newPlayer:WaitForChild('PlayerGui')
03    local p = newPlayer
04    local userId = p.userId
05    newPlayer.CharacterAdded:wait()
06    repeat wait() until newPlayer.PlayerGui ~= nil
07    print("Setting up " .. userId .. "'s resources.")
08    newPlayer.PlayerGui.GUI.Loading.Visible = true
09    newPlayer.PlayerGui.GUI.Loading.ItemName.Text = "Setting up " .. userId .. "'s resources."
10    wait()
11    local ranString = RandomString(20)
12    local v = Instance.new("Model")
13    v.Parent = game.ServerStorage.PlayerDataService
14    v.Name = ranString
15 
View all 38 lines...

Output: "GUI is not a valid member of PlayerGui"

Error line is 08: 'newPlayer.PlayerGui.GUI.Loading.Visible = true'

It's not working. Why?

0
Read my bio. hiimgoodpack 2009 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

Since GUI's are mainly client only, the server (ServerScriptService) cannot access them or edit the contents within them. To make a GUI server wide, you need to use Remote Events. You can find tutorials of remote events on the Guide section of this website, or by browsing the wiki.

0
Solved, Thank you much. zZGalaxySolarManZz 49 — 7y
0
You're welcome! PyccknnXakep 1225 — 7y
Ad

Answer this question