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 / 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
@mvyasu
mvyasu / StickyPlatforms.lua
Last active July 14, 2022 21:15
A simple snippet that attaches the local character to moving platforms that move without physics.
local STICKY_PLATFORM_TAG = "StickyPlatform"
local DISTANCE_TO_CHECK_BELOW = 15
local CollectionService = game:GetService("CollectionService")
local RunService = game:GetService("RunService")
local Player = game:GetService("Players").LocalPlayer
local lastPlatformCFrame = nil
RunService.Heartbeat:Connect(function()
if not Player.Character then
@mvyasu
mvyasu / Ripple.lua
Last active June 26, 2022 15:18
A basic Fusion (v0.2) component that mimics a water ripple.
local Packages = game:GetService("ReplicatedStorage"):WaitForChild("Packages")
local Fusion = require(Packages.Fusion)
local Cleanup = Fusion.Cleanup
local Hydrate = Fusion.Hydrate
local Children = Fusion.Children
local Computed = Fusion.Computed
local Tween = Fusion.Tween
local Value = Fusion.Value
local New = Fusion.New
@mvyasu
mvyasu / ProximityPromptHighlight.lua
Last active April 17, 2026 19:52
A very simple script that highlights objects with ProximityPrompts inside them.
--by @mvyasu
--June 2 2022
local ProximityPromptService = game:GetService("ProximityPromptService")
local Players = game:GetService("Players")
local highlightLookupDictionary = {}
ProximityPromptService.PromptShown:Connect(function(promptInstance)
if not highlightLookupDictionary[promptInstance] then
@mvyasu
mvyasu / themeProvider.lua
Created May 24, 2022 23:30
A very simple theme provider for Fusion. It lacks some useful features, but it's merely an example.
local DEFAULT_THEME = "NAME_OF_THEME"
local Fusion = require(PATH_TO_FUSION)
local Value = Fusion.Value
type themeState = Fusion.StateObject<any>?
type theme = {
{[any]: any}
}