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

My gui wont appear when I change the parent?

I'm trying to make it so when a part is clicked a gui will appear on the screen visibly. I did this by changing the gui's parent to startergui. This didn't work and now I'm stuck wondering what I messed up on or if I even used the right solution.

script.Parent.ClickDetector.MouseClick:Connect(function()
	
	game.ServerStorage.Notification.Parent = game.StarterGui
	
end)

1 comment

0

Parent it to the player gui, player gui is the startergui in each player.

2 answers

✓ Accepted answer

Assuming that that's a local script, local scripts cannot access server storage. This is to prevent exploiters from accessing it as the majority of their code only replicates to the client. To change this just move it from server storage to another place, like lighting or something else.

Check out these links: ServerStorage and filtering enabled

1 comment

0

Oh got it. Thanks!

Expanding on greatneil80 answer:

script.Parent.ClickDetector.MouseClick:Connect(function(player)

    game.ServerStorage.Notification.Parent = player:FindFirstChild("PlayerGui")

end)

Make sure that Notification is a ScreenGui or parent it to already existing ScreenGui.

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