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

How Do I Enable A Frame By Clicking A Button In A Different GUI?

Im trying to make it so if you press a button (SkipCutscene), it enables a frame with a team selecting button.

I made this script which works when i put it in the TeamGui folder

local tgui = script.Parent.Parent.Parent:WaitForChild("TeamGui")
local toggle = tgui:WaitForChild("Toggle")

script.Parent.MouseButton1Click:Connect(function(player)
	toggle.Visible = true

end)

This script works just fine when put in one of the "TeamGui" buttons, but when i put it into the "Cutscene" GUI it just doesn't work.

https://gyazo.com/45b6ba5017a73e526f6edca7ccd92873

Is there a way to enable the frame called "Toggle" (in the TeamGui) by clicking the "SkipCutscene" button in the "Cutscene" GUI?

2 comments

0

There is no "Mousebutton1click" event for ViewPort Frames, Search for events of ViewPort Frame in Object Browser

0

You can change the GUI by going back to the parent of your current GUI

1 answer

Okay i figured it out. I used a cutscene plugin, so the Skip button is controlled by a completely different script in the StarterPlayerScripts folder. I went into the main script and located the TeamGui and the button i wanted to make visible;

local toggle = game:GetService("Players").LocalPlayer:WaitForChild('PlayerGui'):WaitForChild("TeamGui"):WaitForChild("Toggle")

Then there was a line that actually controlled the skip button so i added the "toggle.Visible = true"

	if SkipCutsceneButton and SkipCutsceneButton:IsA("GuiButton") then
		SkipCutsceneButton.MouseButton1Click:Connect(function()			
			
			toggle.Visible = true
			
			Demo:Stop()
		end)
	end

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