Skip to content

Instantly share code, notes, and snippets.

View Nimblz's full-sized avatar
🍳
Scrambling eggs

Austin Reuschle Nimblz

🍳
Scrambling eggs
View GitHub Profile
local function ProcessInput(input)
local ProcessedInputs = {}
for match, _ in input:gmatch("(%a+)\n") do
table.insert(ProcessedInputs,match)
end
return ProcessedInputs
end
local function GetLetters(id)
local Letters = {}
@Nimblz
Nimblz / new.lua
Last active February 2, 2019 07:39
messing around
function new(class,propsDict,childArray)
propsDict = propsDict or {}
childArray = childArray or {}
local newClass = Instance.new(class)
-- Property time
for prop,val in pairs(propsDict) do
if prop ~= "Parent" then
newClass[prop] = val
@Nimblz
Nimblz / megadump.json
Created February 12, 2019 19:15
api dump generated by lpghatguy/dumpling
{"Classes":[{"Name":"Instance","Members":[{"MemberType":"Property","Name":"Archivable","Tags":[],"ValueType":{"Name":"bool","Category":"Primitive"},"Security":{"Read":"None","Write":"None"},"Category":"Behavior","Description":"Determines whether or not an Instance can be saved when the game closes/attempts to save the game. Note: this only applies to games that use Data Persistence, or SavePlaceAsync.","DescriptionSource":"ReflectionMetadata"},{"MemberType":"Property","Name":"ClassName","Tags":["ReadOnly","NotReplicated"],"ValueType":{"Name":"string","Category":"Primitive"},"Security":{"Read":"None","Write":"None"},"Category":"Data","Description":"The string name of this Instance's most derived class.","DescriptionSource":"ReflectionMetadata"},{"MemberType":"Property","Name":"DataCost","Tags":["ReadOnly","NotReplicated"],"ValueType":{"Name":"int","Category":"Primitive"},"Security":{"Read":"LocalUserSecurity","Write":"LocalUserSecurity"},"Category":"Data","Description":null,"DescriptionSource":null},{"MemberTy
-- services
local Players = game:GetService("Players")
local PlayerScripts = Players.LocalPlayer:WaitForChild("PlayerScripts")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
-- paths
local common = ReplicatedStorage:WaitForChild("common")
local common_util = common:WaitForChild("util")
local lib = ReplicatedStorage:WaitForChild("lib")
local moduleBin = PlayerScripts:WaitForChild("module")
local workspace = game:GetService("Workspace")
local replicatedStorage = game:GetService("ReplicatedStorage")
local modules = require(replicatedStorage.modules)
--local pathfinding = modules.load("pathfinding")
local utilities = modules.load("utilities")
local detection = modules.load("detection")
local network = modules.load("network")
local projectile = modules.load("projectile")
local placeSetup = modules.load("placeSetup")

the behavior asset could look something like this maybe

-- AssetBehaviors/BaseballBat.lua
local BatBehavior = {}

function BatBehavior:equippedClient(player, otherArgs...) -- would be called locally whenever you or someone else equips the baseball bat
function BatBehavior:equippedServer(player, otherArgs...) -- called on the server when anyone equips the baseball bat

function BatBehavior:unequippedClient(player)
@Nimblz
Nimblz / CoinSystem.lua
Last active May 28, 2019 19:32
chunk based coin indexing
-- increments the score of players that touch CoinTrigger instances, destroys those instances when touched.
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Workspace = game:GetService("Workspace")
local lib = ReplicatedStorage:WaitForChild("lib")
local common = ReplicatedStorage:WaitForChild("common")
local client = script.Parent.Parent
local util = common:WaitForChild("util")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local common = ReplicatedStorage:WaitForChild("common")
local lib = ReplicatedStorage:WaitForChild("lib")
local Roact = require(lib:WaitForChild("Roact"))
local CodeLabLogo = Roact.Component:extend("CodeLabLogo")
local CODELAB_LOGO_IMAGE = "rbxassetid://3310888975"
return function()
return {
attack = {
inputs = {
{
type = Enum.UserInputType.MouseButton1,
keyCode = nil, -- respond to all inputs of the type
passThrough = true, -- dont block
state = Enum.UserInputState.Begin, -- trigger on this state
},
{
awake = {
enter = function()
return "idle"
end,
step = function()
end,
},
idle = {
enter = function()