Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

7 comments

0

is this a server script?

0

Its inside a GUI.

0

And its a script, not a localscript.

0

I thought gui's were automatically given to players when GUI's are placed in StarterGui

0

What I was trying to say is that I want to give the GUI to all the players without using StarterGui.

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

0

scrpt.Parent.Parent:Clone().Parent = v.PlayerGui

1 answer

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

1 comment

0

ServerStorage hides its children in the game. Developers use ServerStorage to set aside things until they are needed.

This discussion is preserved as it was. New answers, comments, and votes are closed.