repo stringclasses 302
values | file_path stringlengths 18 241 | language stringclasses 2
values | file_type stringclasses 4
values | code stringlengths 76 697k | tokens int64 10 271k |
|---|---|---|---|---|---|
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/RoQuest/Shared/Classes/ObjectiveInfo.luau | luau | .luau | --!strict
local QuestObjective = require(script.Parent.QuestObjective)
local assertProperties = require(script.Parent.Parent.Functions.assertProperties)
export type QuestObjective = typeof(QuestObjective)
--[=[
@class ObjectiveInfo
@tag Class
The ObjectiveInfo contains the static data for our quest objec... | 818 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/RoQuest/Shared/Classes/Quest.luau | luau | .luau | --!strict
local assertProperties = require(script.Parent.Parent.Functions.assertProperties)
local QuestAcceptType = require(script.Parent.Parent.Enums.QuestAcceptType)
local QuestDeliverType = require(script.Parent.Parent.Enums.QuestDeliverType)
local QuestRepeatableType = require(script.Parent.Parent.Enums.QuestRepeat... | 4,389 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/RoQuest/Shared/Classes/QuestLifeCycle.luau | luau | .luau | --!strict
local QuestObjective = require(script.Parent.QuestObjective)
local QuestStatus = require(script.Parent.Parent.Enums.QuestStatus)
local Signal = require(script.Parent.Parent.Parent.Vendor.Signal)
local QuestAcceptType = require(script.Parent.Parent.Enums.QuestAcceptType)
local QuestDeliverType = require(script... | 1,388 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/RoQuest/Shared/Classes/QuestObjective.luau | luau | .luau | --!strict
local QuestObjectiveProgress = require(script.Parent.Parent.Structs.QuestObjectiveProgress)
local assertProperties = require(script.Parent.Parent.Functions.assertProperties)
local Signal = require(script.Parent.Parent.Parent.Vendor.Signal)
local Trove = require(script.Parent.Parent.Parent.Vendor.Trove)
type ... | 1,896 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/RoQuest/Shared/Data/StatusToLifeCycle.luau | luau | .luau | local QuestStatus = require(script.Parent.Parent.Enums.QuestStatus)
return {
[QuestStatus.InProgress] = "OnStart",
[QuestStatus.Completed] = "OnComplete",
[QuestStatus.Delivered] = "OnDeliver",
} | 53 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/RoQuest/Shared/Data/TimeRequirement.luau | luau | .luau | local QuestRepeatableType = require(script.Parent.Parent.Enums.QuestRepeatableType)
local function hoursToSeconds(hours: number): number
return hours * 3600
end
return {
[QuestRepeatableType.Custom] = 0,
[QuestRepeatableType.Daily] = hoursToSeconds(23),
[QuestRepeatableType.Weekly] = hoursToSeconds(16... | 113 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/RoQuest/Shared/Data/WarningMessages.luau | luau | .luau | return {
RoQuestAlreadyInit = "RoQuest has already been initialized",
LoadDirectoryMixedType = "Cannot load directory with mixed file types. Make sure you only load Quests or only QuestLifeCycles",
NoQuestById = "No quest with the id %s was found",
DuplicateQuestId = "Duplicate quest id %s found",
... | 211 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/RoQuest/Shared/Enums/QuestAcceptType.luau | luau | .luau | --!strict
--[=[
@class QuestAcceptType
@tag Enum
Sets if the quest should be accepted automatically or manually
]=]
local QuestAcceptType = {
Automatic = "Automatic",
Manual = "Manual",
}
--[=[
@interface Status
@within QuestAcceptType
.Automatic "Automatic" -- The quest will automatic... | 130 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/RoQuest/Shared/Enums/QuestDeliverType.luau | luau | .luau | --!strict
--[=[
@class QuestDeliverType
@tag Enum
Sets if the quest should be delivered automatically or manually
]=]
local QuestDeliverType = {
Automatic = "Automatic",
Manual = "Manual",
}
--[=[
@interface Status
@within QuestDeliverType
.Automatic "Automatic" -- The quest will autom... | 131 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/RoQuest/Shared/Enums/QuestRepeatableType.luau | luau | .luau | --!strict
--[=[
@class QuestRepeatableType
@tag Enum
Sets how often and if it is possible to repeat a quest
]=]
local QuestRepeatableType = {
NonRepeatable = "NonRepeatable",
Infinite = "Infinite",
Daily = "Daily",
Weekly = "Weekly",
Custom = "Custom",
}
--[=[
@interface Status
... | 210 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/RoQuest/Shared/Enums/QuestStatus.luau | luau | .luau | --!strict
--[=[
@class QuestStatus
@tag Enum
Tracks the current status of the player's quest
]=]
local QuestStatus = {
NotStarted = "NotStarted",
InProgress = "InProgress",
Completed = "Completed",
Delivered = "Delivered",
}
--[=[
@interface Status
@within QuestStatus
.NotStart... | 172 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/RoQuest/Shared/Functions/assertProperties.luau | luau | .luau | local function assertProperties(properties, class)
properties = properties or {}
for index: string, value: any in properties do
if class[index] == nil then
error(string.format("Property %s does not exist in class %s", index, class.__type))
end
if typeof(value) ~= typeof(cla... | 129 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/RoQuest/Shared/Functions/createStruct.luau | luau | .luau | local function createStruct(data)
return setmetatable({}, {
__call = function(_, properties)
local dataTable = setmetatable({}, data)
for index: string, value: any in pairs(data) do
if properties[index] == nil then
if typeof(value) == ... | 118 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/RoQuest/Shared/Functions/loadDirectory.luau | luau | .luau | local WarningMessages = require(script.Parent.Parent.Data.WarningMessages)
local Quest = require(script.Parent.Parent.Classes.Quest)
local QuestLifeCycle = require(script.Parent.Parent.Classes.QuestLifeCycle)
type Quest = Quest.Quest
type QuestLifeCycle = QuestLifeCycle.QuestLifeCycle
local LOAD_DIRECTORY_TYPES: {[st... | 278 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/RoQuest/Shared/Functions/networkQuestParser.luau | luau | .luau | local Quest = require(script.Parent.Parent.Classes.Quest)
type Quest = Quest.Quest
local REPLICATE_PROPERTIES: {[string]: true} = {
Name = true,
Description = true,
QuestId = true,
QuestAcceptType = true,
QuestDeliverType = true,
QuestRepeatableType = true,
QuestStart = true,
QuestEnd ... | 164 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/RoQuest/Shared/Functions/warn.luau | luau | .luau | --!strict
local HEADER: string = "[RoQuest]: "
return function(message: string): ()
warn(HEADER .. message, "\n", debug.traceback())
end | 36 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/RoQuest/Shared/Structs/PlayerQuestData.luau | luau | .luau | local QuestProgress = require(script.Parent.QuestProgress)
local createStruct = require(script.Parent.Parent.Functions.createStruct)
export type QuestProgress = QuestProgress.QuestProgress
--[=[
@class PlayerQuestData
@tag Struct
```csharp
struct PlayerQuestData {
InProgress: {[string]: Quest... | 256 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/RoQuest/Shared/Structs/QuestObjectiveProgress.luau | luau | .luau | local createStruct = require(script.Parent.Parent.Functions.createStruct)
--[=[
@class QuestObjectiveProgress
@tag Struct
```csharp
struct QuestObjectiveProgress {
CurrentProgress: number,
Completed: boolean
}
```
]=]
local QuestObjectiveProgress = {
CurrentProgress = 0,
... | 154 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/RoQuest/Shared/Structs/QuestProgress.luau | luau | .luau | local QuestStatus = require(script.Parent.Parent.Enums.QuestStatus)
local createStruct = require(script.Parent.Parent.Functions.createStruct)
local QuestObjectiveProgress = require(script.Parent.QuestObjectiveProgress)
type QuestStatus = QuestStatus.QuestStatus
type QuestObjectiveProgress = QuestObjectiveProgress.Ques... | 393 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/RoQuest/Vendor/Red/Net/Event.luau | luau | .luau | local RunService = game:GetService("RunService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Remote = ReplicatedStorage:FindFirstChild("RedEvent") :: RemoteEvent
local IS_CLIENT = RunService:IsClient()
local Serdes = require(script.Parent.Serdes)
local Spawn = require(script.Parent.Parent.Ut... | 1,927 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/RoQuest/Vendor/Red/Net/Serdes.luau | luau | .luau | local RunService = game:GetService("RunService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Event = ReplicatedStorage:WaitForChild("RedEvent")
local Promise = require(script.Parent.Parent.Util.Promise)
local Serdes = {}
Serdes.NextId = 0
Serdes.NextOT = 0
function Serdes.RegisterIdentifie... | 372 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/RoQuest/Vendor/Red/Util/Bin.luau | luau | .luau | local Spawn = require(script.Parent.Spawn)
type BinItem = Instance | RBXScriptConnection | () -> ...any
return function()
local Bin: { BinItem } = {}
return function(Item: BinItem)
table.insert(Bin, Item)
end, function()
for _, Item in Bin do
if typeof(Item) == "Instance" then
Item:Destroy()
elseif ... | 131 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/RoQuest/Vendor/Red/Util/Clock.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local function MakeHeartbeatFunction(Clock: Clock)
return function(Delta)
Clock:Advance(Delta)
end
end
local Clock = {}
Clock.__index = Clock
function Clock.Clock(Interval: number, Callback: () -> ())
... | 326 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/RoQuest/Vendor/Red/Util/Collection.luau | luau | .luau | local CollectionService = game:GetService("CollectionService")
local Spawn = require(script.Parent.Spawn)
return function<T...>(Tag: string, Start: (Instance) -> T..., Stop: (T...) -> ()): () -> ()
local InstanceMap = {}
for _, Instance in CollectionService:GetTagged(Tag) do
Spawn(function()
InstanceMap[Insta... | 223 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/RoQuest/Vendor/Red/Util/Promise.luau | luau | .luau | local Spawn = require(script.Parent.Spawn)
local Promise = {}
Promise.__index = Promise
function Promise.Promise(Callback: (Resolve: (...any) -> (), Reject: (...any) -> ()) -> ())
local self = setmetatable({}, Promise)
self.Status = "Pending"
self.OnResolve = {} :: { (...any) -> () }
self.OnReject = {} :: { (...... | 1,039 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/RoQuest/Vendor/Red/Util/Ratelimit.luau | luau | .luau | return function<T>(Limit: number, Interval: number)
assert(Limit > 0, "Limit must be greater than 0")
local CountMap = {} :: { [T]: number }
local CountKeyless = 0
return function(Key: T?)
if Key then
local Count = CountMap[Key]
if Count == nil then
Count = 0
task.delay(Interval, function()
... | 209 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/RoQuest/Vendor/Red/Util/Signal.luau | luau | .luau | local Promise = require(script.Parent.Promise)
local Spawn = require(script.Parent.Spawn)
type SignalNode<T...> = {
Next: SignalNode<T...>?,
Callback: (T...) -> (),
}
export type Signal<T...> = {
Root: SignalNode<T...>?,
Connect: (self: Signal<T...>, Callback: (T...) -> ()) -> () -> (),
Wait: (self: Signal<T...... | 403 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/RoQuest/Vendor/Red/Util/Spawn.luau | luau | .luau | local FreeThread: thread? = nil
local function FunctionPasser(fn, ...)
local AquiredThread = FreeThread
FreeThread = nil
fn(...)
FreeThread = AquiredThread
end
local function Yielder()
while true do
FunctionPasser(coroutine.yield())
end
end
return function<T...>(fn: (T...) -> (), ...: T...)
if not FreeThrea... | 124 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/RoQuest/Vendor/Red/init.luau | luau | .luau | local Net = require(script.Net)
return {
Server = Net.Server,
Client = Net.Client,
Collection = require(script.Util.Collection),
Ratelimit = require(script.Util.Ratelimit),
Promise = require(script.Util.Promise),
Signal = require(script.Util.Signal),
Clock = require(script.Util.Clock),
Spawn = require(script.... | 80 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/RoQuest/Vendor/Signal.luau | luau | .luau | -- -----------------------------------------------------------------------------
-- Batched Yield-Safe Signal Implementation --
-- This is a Signal class which has effectively identical behavior to a --
-- normal RBXScriptSignal, with the only difference being a couple extra ... | 2,702 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/RoQuest/Vendor/Trove.luau | luau | .luau | --!strict
local RunService = game:GetService("RunService")
export type Trove = {
Extend: (self: Trove) -> Trove,
Clone: <T>(self: Trove, instance: T & Instance) -> T,
Construct: <T, A...>(self: Trove, class: Constructable<T, A...>, A...) -> T,
Connect: (self: Trove, signal: SignalLike | RBXScriptSignal, fn: (...a... | 3,857 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/RoQuest/init.luau | luau | .luau | local RunService = game:GetService("RunService")
local Client = require(script.Client)
local Server = require(script.Server)
if RunService:IsClient() then -- No Server object on the client
script.Server:Destroy()
Server = nil
else
Client = nil
end
return setmetatable({
Client = Client,
Server = S... | 175 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/src/ReplicatedStorage/LifeCycles/Client/AppleQuest.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RoQuest = require(ReplicatedStorage.RoQuest).Client
type QuestLifeCycle = RoQuest.QuestLifeCycle
local QuestLifeCycle = RoQuest.QuestLifeCycle
local AppleQuest = QuestLifeCycle {
Name = "AppleQuest",
}
function AppleQuest:OnStart()
-- prin... | 154 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/src/ReplicatedStorage/LifeCycles/Server/AppleQuest.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RoQuest = require(ReplicatedStorage.RoQuest).Server
type QuestLifeCycle = RoQuest.QuestLifeCycle
local QuestLifeCycle = RoQuest.QuestLifeCycle
local AppleQuest = QuestLifeCycle {
Name = "AppleQuest",
}
function AppleQuest:OnStart()
--prin... | 154 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/src/ReplicatedStorage/LifeCycles/Server/CornQuest.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RoQuest = require(ReplicatedStorage.RoQuest).Server
type QuestLifeCycle = RoQuest.QuestLifeCycle
local QuestLifeCycle = RoQuest.QuestLifeCycle
local CornQuest: QuestLifeCycle = QuestLifeCycle {
Name = "CornQuest",
}
return CornQuest | 75 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/src/ReplicatedStorage/ObjectiveInfos/Apple.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RoQuest = require(ReplicatedStorage.RoQuest).Server
local ObjectiveInfo = RoQuest.ObjectiveInfo
return ObjectiveInfo.new {
Description = "%s/%s apples collected",
Name = "Collect Apples",
ObjectiveId = "Apple",
} | 69 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/src/ReplicatedStorage/ObjectiveInfos/Corn.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RoQuest = require(ReplicatedStorage.RoQuest).Server
local ObjectiveInfo = RoQuest.ObjectiveInfo
return ObjectiveInfo.new {
Description = "%s/%s corn collected",
Name = "Collect Corn",
ObjectiveId = "Corn",
} | 68 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/src/ReplicatedStorage/ObjectiveInfos/Flower.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RoQuest = require(ReplicatedStorage.RoQuest).Server
local ObjectiveInfo = RoQuest.ObjectiveInfo
return ObjectiveInfo.new {
Description = "%s/%s flowers collected",
Name = "Collect Flowers",
ObjectiveId = "Flower",
}
| 69 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/src/ReplicatedStorage/ObjectiveInfos/Marble.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RoQuest = require(ReplicatedStorage.RoQuest).Server
local ObjectiveInfo = RoQuest.ObjectiveInfo
return ObjectiveInfo.new {
Description = "%s/%s marbles collected",
Name = "Collect Marbles",
ObjectiveId = "Marble",
} | 71 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/src/ReplicatedStorage/ObjectiveInfos/Zombie.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RoQuest = require(ReplicatedStorage.RoQuest).Server
local ObjectiveInfo = RoQuest.ObjectiveInfo
return ObjectiveInfo.new {
Description = "%s/%s zombies killed",
Name = "Kill Zombies",
ObjectiveId = "KillZombie",
} | 70 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/src/ReplicatedStorage/Quests/Apple.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RoQuest = require(ReplicatedStorage.RoQuest).Server
local appleObjective = require(ReplicatedStorage.ObjectiveInfos.Apple)
local Quest = RoQuest.Quest
return Quest {
Name = "Collect Apples", -- The name of our quest
Description = "Collect 2... | 308 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/src/ReplicatedStorage/Quests/Apple2.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RoQuest = require(ReplicatedStorage.RoQuest).Server
local appleObjective = require(ReplicatedStorage.ObjectiveInfos.Apple)
local Quest = RoQuest.Quest
return Quest {
Name = "Collect Apples", -- The name of our quest
Description = "Collect 3... | 312 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/src/ReplicatedStorage/Quests/CornCurse.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RoQuest = require(ReplicatedStorage.RoQuest).Server
local cornObjective = require(ReplicatedStorage.ObjectiveInfos.Corn)
local Quest = RoQuest.Quest
return Quest {
Name = "Corn Curse!", -- The name of our quest
Description = "Collect 3 corn... | 306 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/src/ReplicatedStorage/Quests/Event.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RoQuest = require(ReplicatedStorage.RoQuest).Server
local flowerObjective = require(ReplicatedStorage.ObjectiveInfos.Flower)
local Quest = RoQuest.Quest
return Quest {
Name = "Collect Flowers", -- The name of our quest
Disabled = true,
... | 322 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/src/ReplicatedStorage/Quests/Flower.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RoQuest = require(ReplicatedStorage.RoQuest).Server
local flowerObjective = require(ReplicatedStorage.ObjectiveInfos.Flower)
local Quest = RoQuest.Quest
return Quest {
Name = "Collect Flowers", -- The name of our quest
Description = "Collec... | 307 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/src/ReplicatedStorage/Quests/InfiniteCorn.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RoQuest = require(ReplicatedStorage.RoQuest).Server
local cornObjective = require(ReplicatedStorage.ObjectiveInfos.Corn)
local Quest = RoQuest.Quest
return Quest {
Name = "Corn Trouble!", -- The name of our quest
Description = "Collect 1 co... | 302 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/src/ReplicatedStorage/Quests/Marble.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RoQuest = require(ReplicatedStorage.RoQuest).Server
local marbleObjective = require(ReplicatedStorage.ObjectiveInfos.Marble)
local Quest = RoQuest.Quest
return Quest {
Name = "Collect Shiny Marble", -- The name of our quest
Description = "C... | 304 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/src/ReplicatedStorage/Quests/Zombie.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RoQuest = require(ReplicatedStorage.RoQuest).Server
local zombieObjective = require(ReplicatedStorage.ObjectiveInfos.Zombie)
local Quest = RoQuest.Quest
return Quest {
Name = "An undead problem!", -- The name of our quest
Description = "Kil... | 309 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/src/ServerScriptService/QuestManager.server.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RoQuest = require(ReplicatedStorage.RoQuest).Server
local Red = require(ReplicatedStorage.RoQuest.Vendor.Red).Server
RoQuest.OnStart():andThen(function()
local Net = Red "QuestManager"
Net:On("AcceptQuest", function(player: Player, questId:... | 163 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/src/ServerScriptService/main.server.luau | luau | .luau | local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local DataStoreService = game:GetService("DataStoreService")
local RoQuest = require(ReplicatedStorage.RoQuest).Server
local questsStore = DataStoreService:GetDataStore("PlayerQuests")
local PlayerQuestData = RoQ... | 454 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/src/StarterPlayerScripts/Components/QuestGiver.client.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local CollectionService = game:GetService("CollectionService")
local RoQuest = require(ReplicatedStorage.RoQuest).Client
local Hud = require(script.Parent.Parent.Interface.Hud)
local Prompt = require(script.Parent.Parent.Interface.Prompt)
local QuestStatus... | 597 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/src/StarterPlayerScripts/Interface/Hud.luau | luau | .luau | --!strict
local Players = game:GetService("Players")
local localPlayer: Player = Players.LocalPlayer
local playerGui: PlayerGui = localPlayer:WaitForChild("PlayerGui")
local questLog: ScreenGui = playerGui:WaitForChild("QuestLog")
local prompts: ScreenGui = playerGui:WaitForChild("Prompts")
local hud: ScreenGui = play... | 293 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/src/StarterPlayerScripts/Interface/Popup.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local SoundService = game:GetService("SoundService")
local Players = game:GetService("Players")
local TweenService = game:GetService("TweenService")
local RoQuest = require(ReplicatedStorage.RoQuest).Client
type Quest = RoQuest.Quest
local localPlayer: P... | 476 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/src/StarterPlayerScripts/Interface/Prompt.luau | luau | .luau | --!strict
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RoQuest = require(ReplicatedStorage.RoQuest).Client
local Red = require(ReplicatedStorage.RoQuest.Vendor.Red).Client
local Hud = require(script.Parent.Hud)
type Quest = RoQuest.Quest
type QuestObj... | 541 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/src/StarterPlayerScripts/Interface/QuestLog.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local RoQuest = require(ReplicatedStorage.RoQuest).Client
local Red = require(ReplicatedStorage.RoQuest.Vendor.Red).Client
type Quest = RoQuest.Quest
local DEFAULT_COLOR: Color3 = Color3.fromRGB(140, 140, 140)
l... | 1,173 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/src/StarterPlayerScripts/Interface/Quests.luau | luau | .luau | local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RoQuest = require(ReplicatedStorage.RoQuest).Client
type Quest = RoQuest.Quest
type QuestObjective = RoQuest.QuestObjective
local QuestStatus = RoQuest.QuestStatus
local localPlayer: Player = Players.Loca... | 798 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/src/StarterPlayerScripts/Interface/init.client.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RoQuest = require(ReplicatedStorage.RoQuest).Client
RoQuest.OnStart():andThen(function()
for _, moduleScript: ModuleScript in script:GetChildren() do
require(moduleScript):Init()
end
end) | 64 |
prooheckcp/RoQuest | prooheckcp-RoQuest-ab9fff8/src/StarterPlayerScripts/main.client.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RoQuest = require(ReplicatedStorage.RoQuest).Client
RoQuest:Init(RoQuest:LoadDirectory(ReplicatedStorage.LifeCycles.Client)) | 48 |
ActualFire-Games/module-loader | ActualFire-Games-module-loader-efa194a/src/ActorScriptTemplate.luau | luau | .luau | --!strict
--@author: crusherfire
--@date: 5/8/24
--[[@description:
Should be placed as a child script of the actor.
]]
-----------------------------
-- DEPENDENCIES --
-----------------------------
local ParallelModuleLoader = require(script.Parent:WaitForChild("ParallelModuleLoader"))
-----------------------------
-... | 175 |
ActualFire-Games/module-loader | ActualFire-Games-module-loader-efa194a/src/ParallelModuleLoader.luau | luau | .luau | --!strict
--@author: crusherfire
--@date: 5/8/24
--[[@description:
General code for parallel scripts.
]]
-- Since this module will be required by scripts in separate actors, these variables won't be shared!
local require = require
local requiredModule
local function onRequireModule(script: BaseScript, module: ModuleSc... | 512 |
ActualFire-Games/module-loader | ActualFire-Games-module-loader-efa194a/src/RelocatedTemplate.luau | luau | .luau | --!strict
local ServerScriptService = game:GetService("ServerScriptService")
local RELOCATED_FOLDER = ServerScriptService:FindFirstChild("RELOCATED_MODULES")
assert(RELOCATED_FOLDER, "ServerScriptService missing 'RELOCATED_MODULES' folder")
local module = RELOCATED_FOLDER:FindFirstChild(script.Name)
assert(module, `R... | 90 |
typeforge-luau/typebrick | typeforge-luau-typebrick-4acc024/src/init.luau | luau | .luau | --!strict
--!nolint LocalShadow
--> Helpers ----------------------------------------------------------------------------
type function assert_is_msg(input: type, input_type: string, label: string, is: string)
local error_msg_start = `\n'{label}' should be of type {is}`
local error_msg_end =
if is_prim... | 5,844 |
littensy/nanoai | littensy-nanoai-56accb8/.lune/check.luau | luau | .luau | --> Runs checks on code quality
local exec = require("util")
exec("luau-lsp analyze --settings=.vscode/settings.json --sourcemap=sourcemap.json src")
exec("selene src")
exec("stylua --check src")
| 54 |
littensy/nanoai | littensy-nanoai-56accb8/.lune/dev.luau | luau | .luau | local exec = require("util")
exec("rojo sourcemap dev.project.json --output sourcemap.json --watch & darklua process src/ rbx/ --watch")
| 37 |
littensy/nanoai | littensy-nanoai-56accb8/.lune/install.luau | luau | .luau | --> Installs dependencies and sets up the sourcemap
local exec = require("util")
exec("wally install")
exec("lune setup")
exec("rojo sourcemap dev.project.json --output sourcemap.json")
| 48 |
littensy/nanoai | littensy-nanoai-56accb8/.lune/util.luau | luau | .luau | --> Internal utility library depended upon by other scripts
local process = require("@lune/process")
local stdio = require("@lune/stdio")
return function(command: string)
local args = command:split(" ")
local program = table.remove(args, 1) :: string
local result = process.spawn(program, args, {
stdio = "forwar... | 149 |
littensy/nanoai | littensy-nanoai-56accb8/src/activation.luau | luau | .luau | export type Activation = "Sigmoid" | "TanH" | "ArcTan" | "SoftPlus" | "Linear" | "ReLU" | "LeakyReLU" | "ELU"
local Activation = {
Sigmoid = "Sigmoid",
TanH = "TanH",
ArcTan = "ArcTan",
SoftPlus = "SoftPlus",
Linear = "Linear",
ReLU = "ReLU",
LeakyReLU = "LeakyReLU",
ELU = "ELU",
}
local functions = {
[Activ... | 563 |
littensy/nanoai | littensy-nanoai-56accb8/src/copy.luau | luau | .luau | --[=[
Creates a deep copy of the given object. Can be used to clone a neural
network, since networks are JSON encodable.
@param object The object to clone.
@return A deep copy of the object.
]=]
local function copy<T>(object: T): T
if type(object) == "table" then
local clone = table.clone(object)
for key, va... | 118 |
littensy/nanoai | littensy-nanoai-56accb8/src/create.luau | luau | .luau | local types = require("./types")
type Network = types.Network
--[=[
Creates a new neural network with the specified shape and activation
functions. The shape is an array of numbers, where each element represents
the amount of neurons in that layer.
@param shape The shape of the network.
@param activation The ac... | 284 |
littensy/nanoai | littensy-nanoai-56accb8/src/evolution.luau | luau | .luau | local task = task or require("@lune/task")
local init = require("./initializers")
local types = require("./types")
type Network = types.Network
local copy = require("./copy")
type Thenable = {
andThen: (self: Thenable, resolved: ((...any) -> ())?, rejected: ((unknown) -> ())?) -> Thenable,
}
export type Agent = {
... | 1,099 |
littensy/nanoai | littensy-nanoai-56accb8/src/init.luau | luau | .luau | local activation = require("./activation")
local backpropagate = require("./backpropagate")
local copy = require("./copy")
local create = require("./create")
local evolution = require("./evolution")
local init = require("./initializers")
local initialize = require("./initialize")
local predict = require("./predict")
lo... | 136 |
littensy/nanoai | littensy-nanoai-56accb8/src/initialize.luau | luau | .luau | local types = require("./types")
type Network = types.Network
export type Filter = "weights" | "biases" | "all"
--[=[
Calls the `initializer` for each weight and bias in the network. If the
`initializer` returns `undefined`, the weight or bias will not be changed.
The `initializer` receives the layer index and th... | 329 |
littensy/nanoai | littensy-nanoai-56accb8/src/initializers.luau | luau | .luau | local Activation = require("./activation").Activation
local initialize = require("./initialize")
type Filter = initialize.Filter
local types = require("./types")
type Network = types.Network
local DEFAULT_GAIN = {
[Activation.TanH] = 5 / 3,
[Activation.ReLU] = 2 ^ 0.5,
[Activation.LeakyReLU] = (2 / 1.01) ^ 0.5,
}
... | 681 |
littensy/nanoai | littensy-nanoai-56accb8/src/predict.luau | luau | .luau | local activation = require("./activation")
local types = require("./types")
type Network = types.Network
--[=[
Feeds the input signal through the network and returns the output signal.
@param network The neural network.
@param input The input signal.
@return The output signal.
]=]
local function predict(network:... | 181 |
littensy/nanoai | littensy-nanoai-56accb8/src/types.luau | luau | .luau | --[=[
The neural network model, containing the neurons, weights, biases, and
activation functions of the network. The network is JSON encodable, so
it is safe to serialize and send over a remote event.
]=]
export type Network = {
--[=[
The total amount of layers in the network, excluding the input layer.
]=]
si... | 310 |
MiaGobble/ExpressivePrompts | MiaGobble-ExpressivePrompts-cbc4974/src/NewInputConnections.luau | luau | .luau | -- Types
type Properties = {
prompt: ProximityPrompt,
ButtonHeldDown: any,
CurrentBarSize: any,
CurrentFrameScaleFactor: any,
PromptTransparency: any,
InputFrameScaleFactor: any,
}
-- Services
local RunService = game:GetService("RunService")
local SoundService = game:GetService("SoundService")
... | 679 |
MiaGobble/ExpressivePrompts | MiaGobble-ExpressivePrompts-cbc4974/src/NewInputLabel/Gamepad/GamepadButtonImage.luau | luau | .luau | return {
[Enum.KeyCode.ButtonX] = "rbxasset://textures/ui/Controls/xboxX.png",
[Enum.KeyCode.ButtonY] = "rbxasset://textures/ui/Controls/xboxY.png",
[Enum.KeyCode.ButtonA] = "rbxasset://textures/ui/Controls/xboxA.png",
[Enum.KeyCode.ButtonB] = "rbxasset://textures/ui/Controls/xboxB.png",
[Enum.KeyCode.DPadLeft] = ... | 417 |
MiaGobble/ExpressivePrompts | MiaGobble-ExpressivePrompts-cbc4974/src/NewInputLabel/Gamepad/init.luau | luau | .luau | -- Constants
local GAMEPAD_BUTTON_IMAGE = require(script.GamepadButtonImage)
return function(Scope : any, prompt, Config : {})
if not GAMEPAD_BUTTON_IMAGE[prompt.GamepadKeyCode] then
return
end
return {
Scope:New("ImageLabel", {
Name = "ButtonImage",
AnchorPoint = V... | 160 |
MiaGobble/ExpressivePrompts | MiaGobble-ExpressivePrompts-cbc4974/src/NewInputLabel/Keyboard/KeyCodeToTextMapping.luau | luau | .luau | return {
[Enum.KeyCode.LeftControl] = "Ctrl",
[Enum.KeyCode.RightControl] = "Ctrl",
[Enum.KeyCode.LeftAlt] = "Alt",
[Enum.KeyCode.RightAlt] = "Alt",
[Enum.KeyCode.F1] = "F1",
[Enum.KeyCode.F2] = "F2",
[Enum.KeyCode.F3] = "F3",
[Enum.KeyCode.F4] = "F4",
[Enum.KeyCode.F5] = "F5",
[Enum.KeyCode.F6] = "F6",
[Enu... | 191 |
MiaGobble/ExpressivePrompts | MiaGobble-ExpressivePrompts-cbc4974/src/NewInputLabel/Keyboard/KeyboardButtonIconMapping.luau | luau | .luau | return {
["'"] = "rbxasset://textures/ui/Controls/apostrophe.png",
[","] = "rbxasset://textures/ui/Controls/comma.png",
["`"] = "rbxasset://textures/ui/Controls/graveaccent.png",
["."] = "rbxasset://textures/ui/Controls/period.png",
[" "] = "rbxasset://textures/ui/Controls/spacebar.png",
} | 94 |
MiaGobble/ExpressivePrompts | MiaGobble-ExpressivePrompts-cbc4974/src/NewInputLabel/Keyboard/KeyboardButtonImage.luau | luau | .luau | return {
[Enum.KeyCode.Backspace] = "rbxasset://textures/ui/Controls/backspace.png",
[Enum.KeyCode.Return] = "rbxasset://textures/ui/Controls/return.png",
[Enum.KeyCode.LeftShift] = "rbxasset://textures/ui/Controls/shift.png",
[Enum.KeyCode.RightShift] = "rbxasset://textures/ui/Controls/shift.png",
[Enum.KeyCode.T... | 106 |
MiaGobble/ExpressivePrompts | MiaGobble-ExpressivePrompts-cbc4974/src/NewInputLabel/Keyboard/init.luau | luau | .luau | -- Constants
local KEYBOARD_BUTTON_IMAGE = require(script.KeyboardButtonImage)
local KEYBOARD_BUTTON_ICON_MAPPING = require(script.KeyboardButtonIconMapping)
local KEYCODE_TO_TEXT_MAPPING = require(script.KeyCodeToTextMapping)
-- Services
local UserInputService = game:GetService("UserInputService")
return function(Sc... | 583 |
MiaGobble/ExpressivePrompts | MiaGobble-ExpressivePrompts-cbc4974/src/NewInputLabel/Touch.luau | luau | .luau | return function(Scope : any, Prompt : ProximityPrompt, Config : {})
return {
Scope:New("ImageLabel", {
Name = "ButtonImage",
ImageColor3 = Config.TextColor,
BackgroundTransparency = 1,
Size = UDim2.fromOffset(25, 31),
AnchorPoint = Vector2.new(0.5,... | 124 |
MiaGobble/ExpressivePrompts | MiaGobble-ExpressivePrompts-cbc4974/src/NewInputLabel/init.luau | luau | .luau | -- Constants
local INPUT_KEY_LABELS = {
[Enum.ProximityPromptInputType.Gamepad] = require(script.Gamepad),
[Enum.ProximityPromptInputType.Touch] = require(script.Touch),
["Default"] = require(script.Keyboard),
}
return function(Scope : any, inputType, prompt, Config : {})
local Component = INPUT_KEY_LA... | 97 |
MiaGobble/ExpressivePrompts | MiaGobble-ExpressivePrompts-cbc4974/src/SoundData.luau | luau | .luau | -- NOTE: This module will be improved when the input connections are recoded
-- Imports
local Packages = script.Parent:FindFirstChild("Packages")
local Seam = if Packages then require(Packages.Seam) else require(script.Parent.Parent.Seam)
-- Variables
local Scope = Seam.Scope(Seam)
return {
AppearSoundId = Scope:... | 153 |
magicoal-nerb/impulse | magicoal-nerb-impulse-1172c61/Simulation.server.luau | luau | .luau | --!native
-- really basic simulation logic
-- for the humanoid and world
-- but, i advise you to make your own!!
assert(not workspace.StreamingEnabled, "this simulation script assumes StreamingEnabled = false")
local Pausing = false
local HZ = 60
local ContextActionService = game:GetService("ContextActionService")
... | 984 |
magicoal-nerb/impulse | magicoal-nerb-impulse-1172c61/luau-humanoid/Humanoid.luau | luau | .luau | --!strict
-- Modern humanoid physics reimplementation
-- in lua
local LuauPhysics = require("../luau-physics")
local World = LuauPhysics.World
export type RaycastResult = LuauPhysics.RaycastResult
local UPDATE_HZ = 480
local VEC_Y_FLIP = Vector3.new(1, -1, 1)
local VEC_XZ = Vector3.new(1, 0, 1)
local CAST_POINTS ... | 3,632 |
magicoal-nerb/impulse | magicoal-nerb-impulse-1172c61/luau-humanoid/init.luau | luau | .luau | -- luau humanoid reaction :3
-- magicoal_nerb
local Humanoid = require("@self/Humanoid")
export type Humanoid = Humanoid.Humanoid
export type State = Humanoid.State
return {
-- main humanoid
Humanoid = require("@self/Humanoid"),
-- states
Freefall = require("@self/states/Freefall"),
Climbing = require("@self/... | 117 |
magicoal-nerb/impulse | magicoal-nerb-impulse-1172c61/luau-humanoid/states/Climbing.luau | luau | .luau | --!strict
local Humanoid = require("../Humanoid")
local Climbing = {} :: Humanoid.State
function Climbing.calculateTorque(self: Humanoid.Humanoid, dt: number): Vector3
-- return the torques so far
return self:computeBalanceTorque(dt)
end
function Climbing.calculateForce(self: Humanoid.Humanoid, dt: number): Vector... | 255 |
magicoal-nerb/impulse | magicoal-nerb-impulse-1172c61/luau-humanoid/states/Freefall.luau | luau | .luau | --!strict
local Humanoid = require("../Humanoid")
local Freefall = {} :: Humanoid.State
function Freefall.calculateTorque(self: Humanoid.Humanoid, dt: number): Vector3
-- return the torques so far
return self:computeBalanceTorque(dt)
+ self:computeOrientTorque(dt)
end
function Freefall.calculateForce(self: Huma... | 277 |
magicoal-nerb/impulse | magicoal-nerb-impulse-1172c61/luau-humanoid/states/Jumping.luau | luau | .luau | --!strict
local Humanoid = require("../Humanoid")
local JUMP_THRESHOLD = 5.0
local VEC_XZ = Vector3.new(1.0, 0.0, 1.0)
local Jumping = {} :: Humanoid.State
function Jumping.calculateTorque(self: Humanoid.Humanoid, dt: number): Vector3
-- return the torques so far
return self:computeBalanceTorque(dt)
+ self:comp... | 609 |
magicoal-nerb/impulse | magicoal-nerb-impulse-1172c61/luau-humanoid/states/Running.luau | luau | .luau | --!strict
local Humanoid = require("../Humanoid")
local COYOTE_HEIGHT = 0.05
local COYOTE_TIMER = 0.1
local Running = {} :: Humanoid.State
function Running.calculateTorque(self: Humanoid.Humanoid, dt: number): Vector3
-- return the torques so far
return self:computeBalanceTorque(dt)
+ self:computeOrientTorque(dt... | 402 |
magicoal-nerb/impulse | magicoal-nerb-impulse-1172c61/luau-physics/Body.luau | luau | .luau | --!strict
local GRAVITY = 196.2
local Hull = require("./narrowphase/Hull")
local Mat3 = require("./Mat3")
local Body = {}
Body.__index = Body
export type Hull = Hull.Hull
export type Mat3 = Mat3.Mat3
export type Body = {
-- body
part: BasePart,
hull: Hull,
-- sleep
sleep: number,
flags: number,
-- querie... | 1,590 |
magicoal-nerb/impulse | magicoal-nerb-impulse-1172c61/luau-physics/Mat3.luau | luau | .luau | --!strict
--!native
-- used to do matrix operations
local Mat3 = {}
Mat3.__index = Mat3
export type Mat3 = typeof(setmetatable({} :: {{ number }}, Mat3))
Mat3.zero = setmetatable({
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
}, Mat3)
Mat3.identity = setmetatable({
{1, 0, 0},
{0, 1, 0},
{0, 0, 1},
}, Mat3)
function Mat... | 2,281 |
magicoal-nerb/impulse | magicoal-nerb-impulse-1172c61/luau-physics/broadphase/Bvh.luau | luau | .luau | --!strict
local BvhBonsaiPrune = require("./builders/BvhBonsaiPrune")
local BvhBinnedSah = require("./builders/BvhBinnedSah")
local Queue = require("./Queue")
local VEC_INF = Vector3.one * math.huge
local FAT_AABB = Vector3.one
-- Truthfully we only care if a node's id
-- is solely FLAG_BRANCH, because that is an i... | 5,087 |
magicoal-nerb/impulse | magicoal-nerb-impulse-1172c61/luau-physics/broadphase/Queue.luau | luau | .luau | --!strict
-- Queue.lua
-- Handles the queue stuff i guess
local Queue = {}
Queue.__index = Queue
export type Queue<T> = typeof(setmetatable({} :: {
left: number,
right: number,
count: number,
mask: number,
data: { T },
}, Queue))
function Queue.new<T>(capacityPow: number, initial: T): Queue<T>
local mask = b... | 331 |
magicoal-nerb/impulse | magicoal-nerb-impulse-1172c61/luau-physics/broadphase/builders/BvhBinnedSah.luau | luau | .luau | --!strict
-- binned sah builder ejemplo
local VEC_INF = Vector3.one * math.huge
local BINS = 8
export type Bin = Node & { count: number }
export type Node = {
center: Vector3,
min: Vector3,
max: Vector3,
}
local BvhSahAxes: { Vector3 } = table.freeze({
Vector3.new(1, 0, 0),
Vector3.new(0, 1, 0),
Vector3.new(0... | 1,008 |
magicoal-nerb/impulse | magicoal-nerb-impulse-1172c61/luau-physics/broadphase/builders/BvhBonsaiPrune.luau | luau | .luau | --!strict
-- optimization phase during construction
-- where we just rotate through the entire tree
-- and make pruned mini trees. good for static stuff
local Queue = require("../Queue")
local FLAG_LEAF = 0x2
export type Box = {
flag: number,
center: Vector3,
min: Vector3,
max: Vector3,
free: number,
left: nu... | 625 |
magicoal-nerb/impulse | magicoal-nerb-impulse-1172c61/luau-physics/broadphase/builders/BvhSweepSah.luau | luau | .luau | --!strict
-- sweep sah has a nlogn penality because of
-- sorting the data. however, it minimizes costs the most
-- using bonsai prune
local VEC_INF = Vector3.one * math.huge
export type Node = {
center: Vector3,
min: Vector3,
max: Vector3,
}
local function sah(delta: Vector3): number
-- the main cost function ... | 952 |
magicoal-nerb/impulse | magicoal-nerb-impulse-1172c61/luau-physics/init.luau | luau | .luau | local World = require("@self/World")
export type Support = World.Support
export type World = World.World
export type Body = World.Body
export type Bvh = World.Bvh
return {
World = require("@self/World"),
} | 51 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.