Skip to content

Instantly share code, notes, and snippets.

View lolmanurfunny's full-sized avatar

lolmanurfunny

  • 23:46 (UTC -04:00)
View GitHub Profile
@Rerumu
Rerumu / luau_in_luau.lua
Last active April 21, 2024 00:22
Luau translated to Luau, as a Studio compatible script
This file has been truncated, but you can view the full file.
-- Roblox's Luau as a Luau script
-- Translated using https://github.com/Rerumu/Wasynth
local luau_script = [[
print("Hello, World!")
]]
local Integer = (function()
local Numeric = {}
@jovannic
jovannic / weld_truth.md
Last active November 8, 2022 05:27
The Truth About Welds

Since we don't have this documented anywhere, I'll explain real quick.

The Truth About Welds

Weld, Snap, WeldConstraint, Motor, and Motor6D joints all combine multiple parts into the same Assembly. An assembly is a rigid body if none of it's parts are anchored. No physical forces can ever separate the parts of an Assembly or move them relative to each other unless the joints are removed or updated. They're a single body.

Every Assembly has a root part, see BasePart:GetRootPart. When a weld is C0/C1 is modified the root part will stay where it was.

Welds do not have any directionality. Part0 or Part1, doesn't matter. You can imagine rigid joints forming a tree branching down from the root part. All the parts down the tree from root will move, and their welded "children" in this tree will move with them.

@evaera
evaera / Clean Code.md
Last active April 10, 2024 22:49
Best Practices for Clean Code
  1. Use descriptive and obvious names.
    • Don't use abbreviations, use full English words. player is better than plr.
    • Name things as directly as possible. wasCalled is better than hasBeenCalled. notify is better than doNotification.
    • Name booleans as if they are yes or no questions. isFirstRun is better than firstRun.
    • Name functions using verb forms: increment is better than plusOne. unzip is better than filesFromZip.
    • Name event handlers to express when they run. onClick is better than click.
    • Put statements and expressions in positive form.
      • isFlying instead of isNotFlying. late intead of notOnTime.
      • Lead with positive conditionals. Avoid if not something then ... else ... end.
  • If we only care about the inverse of a variable, turn it into a positive name. missingValue instead of not hasValue.