Hide a frame after one second

Tool.Equipped:Connect(function(Mouse)
	Mouse.Button2Down:Connect(function()
		if FireMode.Text == "Automatic" then
			script.Parent.Text = "Switched to Automatic"
			script.Parent.Parent.Parent.Visible = true
			task.wait(1)
			script.Parent.Parent.Parent.Visible = false
		elseif FireMode.Text == "Burst-fire" then
			script.Parent.Text = "Switched to Burst-fire"
			script.Parent.Parent.Parent.Visible = true
			task.wait(1)
			script.Parent.Parent.Parent.Visible = false
		end
	end)
end)

this works, but if you spam it hides the frame fast

That is because you are using the same frame to show the weapon’s information.

To counter this problem you can either use a different frame for each firemode respectively, or just simply check if the frame’s content is the same after the 1 second delay, if it is then make the frame be invisible, otherwise have the frame stay visible.

I recommend the second method for you. *

Do this:

Tool.Equipped:Connect(function(Mouse)
	Mouse.Button2Down:Connect(function()
		if FireMode.Text == "Automatic" and script.Parent.Parent.Parent.Visible == false then
			script.Parent.Text = "Switched to Automatic"
			script.Parent.Parent.Parent.Visible = true
			task.wait(1)
			script.Parent.Parent.Parent.Visible = false
		elseif FireMode.Text == "Burst-fire" then
			script.Parent.Text = "Switched to Burst-fire"
			script.Parent.Parent.Parent.Visible = true
			task.wait(1)
			script.Parent.Parent.Parent.Visible = false
		end
	end)
end)