This file contains 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 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 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 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 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 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 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" | |
) |
This file contains 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
--[[ | |
Copyright © 2022 Stephen Leitnick | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | |
documentation files (the “Software”), to deal in the Software without restriction, including without limitation | |
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, | |
and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions | |
of the Software. |
This file contains 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
-- Log | |
-- Stephen Leitnick | |
-- April 20, 2021 | |
--[[ | |
IMPORTANT: Only make one logger per script/module | |
Log.Level { Debug, Info, Warn, Severe } |
This file contains 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
-- Platform | |
-- Crazyman32 | |
-- November 6, 2018 | |
--[[ | |
This should be a LocalScript within StarterCharacterScripts. | |
This creates platform parts as the player runs around. It does | |
not replicate the platforms to other players. So only the local |
NewerOlder