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

GUI not being placed inside the player's PlayerGui. How do I fix this?

Asked by 4 years ago
Edited 4 years ago

I did this really simple script that gets all the players and places the script's parent inside the players own PlayerGui, but nothing is happening. The output is not speaking and I've tried using wait() because I thought the script probably was executing before any players joined the game. Heres the script:

local Players = game:GetService("Players")
local pc = Players:GetPlayers()

for i,v in pairs(pc)do
    script.Parent.Parent:Clone().Parent = v.PlayerGui
end
0
is this a server script? HappyTimIsHim 652 — 4y
0
Its inside a GUI. Prxticles 13 — 4y
0
And its a script, not a localscript. Prxticles 13 — 4y
0
I thought gui's were automatically given to players when GUI's are placed in StarterGui bittersweetfate 142 — 4y
View all comments (3 more)
0
What I was trying to say is that I want to give the GUI to all the players without using StarterGui. Prxticles 13 — 4y
0
use :GetPlayers() instead of GetChildren() but maybe u should try like a 5 seconds wait to see if the script is executing before a player joins HappyTimIsHim 652 — 4y
0
scrpt.Parent.Parent:Clone().Parent = v.PlayerGui Ziffixture 6913 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

Looks like where I placed the script and the GUI somehow stopped the script? I originally placed it in ServerStorage, and that somehow caused a reaction to the script and GUI. After I placed it in Workspace, and made the GUI inside of the script, and not the script inside the GUI, it proceeded to work. I don't know why ServerStorage caused this, but I'm glad I fixed the problem

0
ServerStorage hides its children in the game. Developers use ServerStorage to set aside things until they are needed. AntiWorldliness 868 — 4y
Ad

Answer this question