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 / Typewriter.lua
Created November 19, 2022 08:53
A simple typewriter example that allows for the previously set text to be overwritten without any problems.
local textLabel = script.Parent
local lastUpdateTextThread = nil
local function updateText(newText: string)
if lastUpdateTextThread then
task.cancel(lastUpdateTextThread)
lastUpdateTextThread = nil
end
lastUpdateTextThread = task.spawn(function()
@mvyasu
mvyasu / Celestial.lua
Last active October 29, 2022 23:24
A small module that contains some useful functions for manipulating celestial bodies.
--!strict
local atan2 = math.atan2
local sqrt = math.sqrt
local circleCircumference = math.pi*2
local function getGeoTimeForPointDirection(pointDirection: Vector3, longitudeFactor: number?): (number, number)
local realLongitudeFactor = longitudeFactor or -1
@mvyasu
mvyasu / CameraSubjectLocalTransparency.lua
Last active October 28, 2022 00:40
A simple LocalScript that will hide the player's character when they zoom into the current CameraSubject if it isn't a humanoid.
--CameraSubjectLocalTransparency
--by @mvyasu
local HIDE_CHARACTER_WHEN_DISTANCE_IS_LESS_THAN = 5
local SHOULD_TWEEN_TRANSPARENCY = false
local TRANSPARENCY_TWEEN_INFO = TweenInfo.new(1)
local TweenService = game:GetService("TweenService")
@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")