Skip to content

Instantly share code, notes, and snippets.

@MrChickenRocket
MrChickenRocket / ReplicatedFirst_KinematicObjectsClientScript.lua
Last active September 23, 2025 19:16
Kinematic animated objects for roblox. Tag anchored server objects with "Kinematic" and the motion and physics code is magic'd away.
if (script:IsDescendantOf(game.ReplicatedFirst) == false) then
error(script.Name .. "needs to be in ReplicatedFirst")
end
local CollectionService = game:GetService("CollectionService")
local kinematicObjects = {}
local function AddInstance(target)
@MrChickenRocket
MrChickenRocket / astar.lua
Created July 31, 2022 04:25
Relatively well optimized Astar for luau (uses a kinda clever priority queue to avoid searching the open list for best f)
local module = {}
local INF = 1/0
function dist ( x1, y1, x2, y2 )
return math.sqrt ( math.pow ( x2 - x1, 2 ) + math.pow ( y2 - y1, 2 ) )
end
function heuristic_cost_estimate ( nodeA, nodeB )
return dist ( nodeA.x, nodeA.y, nodeB.x, nodeB.y ) * 2000
local DeltaTable ={
--[[
This module is for getting the difference between a table and then
being able to merge it back in.
-- Specifically great for networking as it allows us only to send what has changed
This is an independant Module because it has enough parts to it, that it should be
seperated from ADTs and or some sort of "Table" lib. This is abstractly a table differ.
--]]
_VERSION = 2.0