Why doesn't the "back to menu" button show up?

local player = game.Players.LocalPlayer
local teams = game:GetService("Teams")
local camera = game.Workspace.CurrentCamera

workspace:WaitForChild("MenuCamera")

camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = game.Workspace.MenuCamera.CFrame

wait(0.1)
--game.Workspace.MenuCamera.Sound.Playing = true
game.Workspace.MenuCamera.MerryChristmas.Playing = true
game.Workspace.MenuCamera.ChristmasTheme.Playing = true

-- Get the TextButton
local textButton = script.Parent -- assuming the script is a child of the TextButton
local originalText = textButton.Text
local hoverText = "> PLAY <"
local click = script.Parent.Parent.Parent.Parent.click
local current = game.Players.LocalPlayer.PlayerGui:WaitForChild("BackMain")
local currentframe = current.TextButton

local function onMouseEnter()
	click:Play()
	textButton.Text = hoverText
end

local function onMouseLeave()
	textButton.Text = originalText
end

textButton.MouseEnter:Connect(onMouseEnter)
textButton.MouseLeave:Connect(onMouseLeave)

script.Parent.MouseButton1Click:Connect(function()
	if player.Team == teams.lobby then
		print("if statement 1 used")
		script.Parent.Parent.warning.TextTransparency = 0
		wait(5)
		script.Parent.Parent.warning.TextTransparency = 1
	else
		print("if statement 2 used")
		camera.CameraType = Enum.CameraType.Custom	
		print("change cam")
		camera.CameraSubject = player.Character.Humanoid
		print("fixed cam")
		
		currentframe.Visible = true
		print("showed button")
		script.Parent.Parent.Parent.Parent.Container.Visible = false
		game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true)
	--	game.Workspace.Music.Enabled = true
	end
end)

so basically when the player clicks “play” the other GUI is supposed to appear.

im getting no errors either, any ideas?

5 Likes

also to clarify by default this “back to menu” button is set by default to Visible = false through the properties tab

1 Like

Could you provide some of the logs from console/what gets printed?

2 Likes

Could you please provide more information.

2 Likes

yeah so what actually gets printed is the “if statement 1/2 used” “change cam” “fixed cam” “showed button” etc.

what IM thinking is because this is in a local script there’s something weird going on with the local current = game.Players.LocalPlayer.PlayerGui:WaitForChild("BackMain")

otherwise?

1 Like

what else would you like to know?

been reading up on other posts like this, but none of them seem to provide a legitimate solution i can comprehend?

also this is all in a local script, if that changes anything

my main problem is at currentframe.Visible = true

1 Like

Is the screenGui enabled if it’s disabled all what’s inside is invisible

can you rephrase please? im not sure i understand what youre trying to say.

Good here’s a ai clarification (for those with the habits to check if something is AI generated)

If a ScreenGui is disabled, all its contents become invisible.

1 Like

its not disabled though, im very sure. the only disabled properties on the UIs are “visible” which needs to be enabled - the enabling part on the client side isnt working

1 Like

Hi! I did some tests, and i script show up the button like normal. So i think problem in your gui.
Can you please save it to file and send here?

1 Like

unfortunately im not comfortable with sending you the files because its from a more complex game that has had much time and effort put into it

can you send me your file instead?

1 Like

Sure
Text.rbxm (9.1 KB)

1 Like

what exactly does this solve? the backmain button is meant to be invisible until the player presses the play button

1 Like

Yes, and it’s invisible until the player press the button

1 Like

this is so weird, can i contact you via a blue app? i think it would be more profitable - username is revivepiracy

yours seems to work but mine still doesnt

i can share the file through there

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.