Script not showing up when parented to PlayerGui

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!

I want to parent a script to a folder under a ScreenGui under PlayerGui.

  1. What is the issue? Include screenshots / videos if possible!

When the script is parented to the folder, Roblox treats the script as if it’s there but looking in the inspector shows otherwise. This happens with both server and local scripts, so I know that isn’t the issue.

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I’ve tried directly parenting the script instead of making a clone, same issue. This doesn’t happen when I manually create a script in studio then press play. I cannot find anything else on the Developer Hub even remotely relating to this issue, I’ve looked for half an hour at this point.

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

I don’t know if this is just a bug or whatever, but it’s genuinely annoying me. This makes absolutely no sense whatsoever, and even destroying the folder the script is in doesn’t fire any :Destroyed() events on the script. Using :GetChildren() on the folder shows the script is there, but my issue is it doesn’t show up in studio and I cannot see what is happening there for debugging. This is for a quest system where I parent a quest script into the gui, and the script will hook up to any events to manage quest progress.

Code:

serverStorage.Quests.Test.Parent = plr:WaitForChild("PlayerGui"):WaitForChild("MainUI"):WaitForChild("QuestScripts")
	
wait(1)
print(plr:WaitForChild("PlayerGui"):WaitForChild("MainUI"):WaitForChild("QuestScripts"):GetChildren())

This is in a PlayerAdded function, so it is fired right when a player joins. “plr” refers to the player who joined. serverStorage is game.ServerStorage, “Quests” is a folder in serverStorage, “Test” is a script.

The wait(1) before printing is just there to make sure the script isn’t being destroyed after a print() function is called to print the children of the folder.

Edit: If there is anywhere else I can parent these scripts to where BOTH server and local scripts will run, and will not be reset when the character dies, that would be a good help too. I’m doing it this way so the rest of the people on my team can easily make scripts themselves, since they can script but don’t understand anything too advanced so I need to make adding things like items, weapons, quests, etc. easy for them.

I have a question, have you tried directly putting this Script under StarterGUI and your GUI? That should work, even though I don’t know what the problem may be sorry :cry:

Also sorry, but I don’t understand how this could help, if there’s something I missed which explains this I’m very sorry

Do you mean putting the script into starterGui before I press play or when the player joins?

Also sorry I’m terrible at explaining things, but they just work better with this kind of structure.

I mean like put the Script in StarterGUI before starting the Game, also if you try to build while testing it’s not gonna work, it doesn’t allow you to publish and if you stop it will delete everything, for scripts there’s the save feature luckily
But don’t do this while testing, I lost a Game (my first, it was very low effort)

A Server Script will not work in places like StarterGUI. You should use a LocalScript Instead.

Yes, I think he knows that, it was implied…

This Simply Isn’t true, Server Scripts still works.

1 Like

LocalScripts simply cannot access ServerStorage that may be his problem there.

Ah, thanks for correcting me there.

The issue isn’t that the script isn’t working. The issue that it all works fine, but in the inspector the script doesn’t show up. This is extremely worrying to me because I have no idea if this is just a Roblox bug, or if there’s any underlying issue that will completely break the game in the future. If that wasn’t clear before, I’m sorry. This is the first time I’m asking for any sort of help on here.

1 Like