This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Add lines to here & run script | |
local lines = [[ | |
local Roact = require(script.Parent.Parent.Parent.Packages.Roact) | |
local RoactRodux = require(script.Parent.Parent.Parent.Packages.RoactRodux) | |
local Constants = require(script.Parent.Parent.Plugin.Constants) | |
local ThemeContext = require(script.Parent.ThemeContext) | |
]] | |
-- e.g. output from above: | |
--[[ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--!strict | |
local function find(parent: Instance, ...: string): Instance | |
local instance = parent | |
for i = 1, select("#", ...) do | |
local name = (select(i, ...)) | |
local inst = instance:FindFirstChild(name) | |
if inst == nil then | |
error(`failed to find instance "{name}" in {instance:GetFullName()}`, 2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--!native | |
--!strict | |
-- Source of calculations: https://gml.noaa.gov/grad/solcalc/calcdetails.html | |
export type SolarData = { | |
JulianDay: number, | |
JulianCentury: number, | |
GeometricMeanLongitudeSunDeg: number, | |
GeometricMeanAnomSunDeg: number, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local coolSword = game:GetService("ReplicatedStorage").Assets.Swords.CoolSword |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--!native | |
--!optimize 2 | |
--[[ | |
ClosestPickup | |
- LocalScript inside StarterCharacterScripts | |
- MAX_RADIUS is not really a radius, but rather the zone cube size | |
- It searches for BaseParts in the workspace with the 'Pickup' tag | |
- It assumes BasePart; non BaseParts with the same tag will break this test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--!strict | |
--[[ | |
Find(parent: Instance, path: string, [assertIsA: string]): Instance | |
e.g. | |
child = Find(parent, "ChildName") | |
child = Find(parent, "ChildName", "BasePart") | |
child = Find(parent, "ChildName/Some/Nested/Object") | |
child = Find(parent, "ChildName/Some/Nested/Object", "BasePart") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Run in LocalScript context. | |
-- Move mouse around to see Input event ordering in the output as well. | |
local RunService = game:GetService("RunService") | |
local UserInputService = game:GetService("UserInputService") | |
local lastT = 0 | |
local function FmtTime() | |
local t = time() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- MyService.lua | |
local MyService = {} | |
function MyService:DoSomething() | |
print("Do something") | |
end | |
return MyService | |
---------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local MyService = {} | |
return MyService |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Load all ModuleScripts within 'MyModules' that end with "Service" & call their OnStart methods. | |
Loader.SpawnAll( | |
Loader.LoadDescendants(MyModules, Loader.MatchName("Service$")), | |
"OnStart" | |
) |
NewerOlder