Spinning objects

This commit is contained in:
2024-04-01 22:59:28 -04:00
parent ef8ceb723f
commit be99c7d986
8 changed files with 122 additions and 65 deletions

View File

@@ -9,7 +9,8 @@ local RS: ReplicatedStorage = game:GetService("ReplicatedStorage")
local TagsModule = require(RS:WaitForChild("Tags"))
local Enums = require(Elevators:WaitForChild("Enums"))
type Tags = TagsModule.ExportedTags
type TagsConstructor = TagsModule.TagsConstructor
type TagProduct = TagsModule.TagProduct
type HumanoidRootPart = BasePart
type PromptCallback = (Player: Player) -> ()
@@ -30,9 +31,9 @@ type Impl_Static_Props = {
ButtonEnum: any
}
type Constructor_Fun = (Tags: Tags, Model: string) -> ClassConstructor
type Constructor_Fun = (TagsConstructor: TagsConstructor, Model: string) -> ClassConstructor
type Constructor_Return_Props = {
Tags: Tags,
Tags: TagsConstructor,
Model: string,
Buttons: ButtonsTree
}
@@ -53,9 +54,9 @@ export type ButtonsConstructor = ClassConstructor
local ButtonsModule = {} :: Impl_Constructor
ButtonsModule.__index = ButtonsModule
function ButtonsModule.constructor(Tags, Model)
function ButtonsModule.constructor(TagsConstructor, Model)
return setmetatable({
Tags = Tags,
Tags = TagsConstructor,
Model = Model,
Buttons = {
Landing = {},
@@ -76,7 +77,7 @@ end
function ButtonsModule:Get()
local Buttons: GetButtons = {}
for TagName: string, Inst: Instance | {Instance} in self.Tags do
for TagName: string, Inst: TagProduct in self.Tags.__export do
local Split = TagName:split('_')
if Split[1] == self.Model and (Split[2] == "ElevatorButton" or Split[2] == "RelayButton") then
if typeof(Inst) == "Instance" then