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

gui button not expanding on click?

Hi, so I'm editing a friend's game that's created as an Interview Center. There's this button (Screen GUI) that says 'Interview Questions', and when you click on it, it's supposed to expand with the interview questions. However, there's an error and it's not expanding on click. I'm unsure what's causing this and I would like to ask for help. Any feedback / suggestions will be very helpful.

Check (Under ScreenGUI)

repeat wait() until script.Parent.Parent.Name ~= "StarterGui"
plr = script.Parent.Parent.Parent

if plr:GetRankInGroup(3312565) <8 then
	if plr.Name == "" or plr.Name == "aelzc" or plr.Name == "iiPotato_Queenxx" then
		return
	end
	script.Parent:Destroy()
end

Script (Under Button > Button)

script.Parent.MouseButton1Down:connect(function()
	script.Parent.Parent.Visible = false
	script.Parent.Parent.Parent.Questions.Visible = true
end)

Script (Under Questions > Button)

script.Parent.MouseButton1Down:connect(function()
	script.Parent.Parent.Visible = false
	script.Parent.Parent.Parent.Button.Visible = true
end)

4 comments

0

repeat wait() until script.Parent.Parent.Name ~= "StarterGui" isnt needed, it gets cloned into the Player Gui

0

also, server scripts dont run on the client and can't modify gui elements(assuming it's not a local script because you said "Script")

0

@theking Yeah, it's not a local script. Should I make it local?

0

LMAO, thank you so much. I made them local and it worked.

1 answer

✓ Accepted answer

You need to use local scripts if the script is for that player only.

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