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

Why Does The Frame Appears Then Disappears? (VIDEO)

So, I'm almost finished with the frame switching it's just when I played, the main frame disappeared and I saw the Character Customize Frame, but in around milliseconds, it disappears. What code is making it do it? Here are all of the code that has to do with the Character Frame & the Main Menu frame.

local PlayButton = script.Parent-- This is when the "New Game" button disappears code.
PlayButton.MouseButton1Click:Connect(function()
wait(0.1)--Duration before it goes away
script.Parent.Parent.Visible = false
end)
local Button = script.Parent-- This makes the main menu frame disappear
Frame = script.Parent

function onClick()
	if Frame.Visible == false then
	Frame.Visible = true
	elseif Frame.Visible == true then
		Frame.Visible = false
	end
end

Button.MouseButton1Click:Connect(onClick)
local Button = script.Parent-- This is the code for trying to make the Character Frame appear
Frame2 = script.Parent.Parent.CharacterFrame-- After the button was clicked.

function onClick()
	if Frame2.Visible == false then
	Frame2.Visible = true
	elseif Frame2.Visible == true then
		Frame2.Visible = false
	end
end

Button.MouseButton1Click:Connect(onClick)

So, what are the problems inside of the code that has to do with the Character Frame disappearing in a really short period of time?

(copy this link and paste then press enter) www.youtube.com/watch?v=AGJT5h-1S8o

2 comments

0

Note: These are all of the code that has to do with the Character Frame.

1 answer

There are 2 strings named "button". The issue is that the both buttons are being registered and nothing works. as well there are 2 functions named onClick. If these are not in the same script just MSG me and I'll help you. Also make sure they are localscripts!

1 comment

0

They are local scripts though

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