Skip to content

Instantly share code, notes, and snippets.

View mvyasu's full-sized avatar
😪
Tired

Yasu Yoshida mvyasu

😪
Tired
View GitHub Profile
@mvyasu
mvyasu / contextualStudioTheme.lua
Last active July 5, 2025 15:21
A variant of my studio theme provider that uses a contextual
--!strict
local Studio = settings().Studio
local Packages = script.Parent.Parent.Packages
local Fusion = require(Packages.Fusion)
local Contextual = Fusion.Contextual
local Computed = Fusion.Computed
local Value = Fusion.Value
@mvyasu
mvyasu / createWireChainWith.lua
Last active July 5, 2025 15:26
chains together different wireable objects with wires in an easy to understand manner
--!strict
type AudioModifier = AudioEcho | AudioFader | AudioChorus | AudioReverb | AudioFlanger | AudioEqualizer | AudioCompressor | AudioDistortion | AudioPitchShifter
type AudioProcessor = AudioAnalyzer | AudioListener
type AudioOutput = AudioEmitter | AudioDeviceOutput
type AudioInput = AudioDeviceInput | AudioPlayer
export type Wireable = AudioModifier | AudioProcessor | AudioOutput | AudioInput
local function createWire(source: Wireable, target: Wireable, sourceName: string, targetName: string, parent: Instance): Wire
local MATERIAL_DEMO_SIZE = 4
local MATERIAL_DEMO_SPACING = 1
local MATERIAL_DEMO_SHAPE = Enum.PartType.Block
local MATERIAL_DEMO_COLOR = Color3.fromRGB(255, 255, 255)
local MATERIAL_DEMO_OFFSET = Vector3.yAxis * MATERIAL_DEMO_SIZE/2
local USE_COLUMNS = true
local MATERIALS_PER_ROW = 12
local createdMaterialDemos = {} do
@mvyasu
mvyasu / rawTween.lua
Last active July 11, 2023 02:15
Runs a tween inside a loop that can be used alongside the task library
local function rawTween(tweenInfo: TweenInfo, tweenCallback: (tweenAlpha: number) -> nil)
local tweenEasingStyle = tweenInfo.EasingStyle
local tweenEasingDirection = tweenInfo.EasingDirection
local tweenRepeatCount = tweenInfo.RepeatCount
local tweenIndefinitely = tweenRepeatCount<=-1
local tweenDelay = tweenInfo.DelayTime
local tweenDuration = tweenDelay + tweenInfo.Time
local tweenReverses = tweenInfo.Reverses
@mvyasu
mvyasu / studioThemeProvider.lua
Last active August 7, 2023 03:23
A simple studio theme provider that can be used for plugins made with Fusion
--!strict
local Plugin = script:FindFirstAncestorWhichIsA("Plugin")
local Packages = script.Parent.Parent.Packages
local Fusion = require(Packages.Fusion)
local Studio = settings().Studio
local Computed = Fusion.Computed
local Value = Fusion.Value
@mvyasu
mvyasu / VirtualScroller.lua
Last active June 27, 2024 19:46
A component made for Fusion that is a ScrollingFrame that allows extremely large numbers of elements to exist with better performance
-- originally by @boatbomber
-- modified by @mvyasu
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Fusion = require(ReplicatedStorage.Fusion)
local unwrap = require(ReplicatedStorage.Fusion.State.unwrap)
local Children = Fusion.Children
local ForPairs = Fusion.ForPairs
@mvyasu
mvyasu / HideCharacters.lua
Last active February 27, 2025 22:22
A quick and easy way to hide characters by setting attributes. If you want this to work with StreamingEnabled, you should handle the tagging of characters with a server script instead of with the provided snippet at the bottom.
--by @mvyasu
--4 May 2023
--A quick and easy way to hide characters by setting attributes
--To change whether characters are hidden do: game.Players:SetAttribute("HideCharacters", true)
--To exclude a player's character from being hidden do: game.Players.LocalPlayer:SetAttribute("NeverHideCharacter", true)
local CHARACTER_TAG = game:GetService("HttpService"):GenerateGUID()
local CollectionService = game:GetService("CollectionService")
@mvyasu
mvyasu / Cleanup.lua
Last active February 17, 2024 19:28
A simple cleanup function
local function cleanupObject(object: any)
local t = typeof(object)
if t == "function" then
object()
elseif t == "RBXScriptConnection" then
object:Disconnect()
elseif t == "table" or t =="Instance" then
if object.Destroy then
object:Destroy()
else
@dphfox
dphfox / Serde.lua
Created July 27, 2022 19:12
Serialisation/deserialisation of values to attribute-safe and storage-safe formats
--[[
Utilities for serialising and deserialising values for safe representation
in limited media, for example when saving to plugin storage or attributes.
(c) Elttob 2022 - Licensed under MIT
]]
local HttpService = game:GetService("HttpService")
local Serde = {}