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

Why doesn't this script close the frame when txt button is clicked?

local yeet = script.Parent
local scary = script.Parent.Scary
local box = script.Parent.Parent
	yeet.MouseButton1Click:Connect(function()
	box.Visible = false
end)

When the text button is clicked the frame doesn't close please help!

1 comment

1

Try to use a LocalScript.

1 answer

First, you can not use Server Scripts in Gui's of StarterGui, all StarterGui Gui's are replicated for the client. you can only use local scripts in these GUI's. if the GUI is replicated for the server you can even use server script on it. however if it was created by StarterGui as stated above there is no way to use server scripts.

Summary: Do not use Server Scripts in GUI's of StarterGui. just use LocalScript in these GUI's

Your code is perfect do not have anything errors.

Use LocalScript in this Gui's.

Hope it helped!

4 comments

0

GUIs are not created by the client, they are replicated to the client via StarterGui.

0

I'll edit the answer, but I just meant that the GUI would only be created for the client.

0

It wasn't a dig on your answer, just a clarification.

0

I know, thanks for saying this so I will edit and the person who asked about it will understand more.

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