Skip to content

Instantly share code, notes, and snippets.

View stravant's full-sized avatar

Mark Langen stravant

  • Roblox
  • Bay Area
View GitHub Profile
workspace.Checkpoints.ChildAdded:Connect(function(checkpoint)
if checkpoint.Name == "100" then
checkpoint.Touched:Connect(function(hit)
... same touched stuff
end)
end
end)
for i = 1, 5 do
local part = game.ReplicatedStorage.FogPart:Clone()
part.Parent = workspace
part.Position = Vector3.new(0, i * 10, 0)
end
@stravant
stravant / DatastoreBytes.lua
Created October 24, 2023 04:50
Module which packs a sequence of variable length integers into a Datastore safe string at maximal density
local DS_INT_TO_INT = {} :: {[number]: number}
local INT_TO_DS_INT = {} :: {[number]: number}
local INT_TO_DS_CHAR = {} :: {[number]: string}
local DS_INT_MAX;
do
-- All characters under this are control characters, must avoid them because
-- they get expanded out into control sequences.
local MIN_DS_VALUE = 0x20
local MAX_DS_VALUE = 0x7E
@stravant
stravant / reloader.gd
Last active August 22, 2024 22:55
Simple plugin auto-reloader for Godot plugin development
################################################################################
## stravant's Godot plugin auto-reloader ##
## For ease of plugin development ##
## MIT licensed ##
## ##
## Call preload("./reloader.gd").new() in your EditorPlugin component's ##
## _enter_tree method to enable automatic reloading whenever you save changes ##
## to any of the plugin files for a tighter plugin rapid prototyping loop. ##
## ##
## Source: https://gist.github.com/stravant/7aec484bb5e34e3a6196faaa13159ac3 ##