diff --git a/default.project.json b/default.project.json index 38c648a..1375ba1 100644 --- a/default.project.json +++ b/default.project.json @@ -6,7 +6,10 @@ "$path": "src/shared" }, "ServerScriptService": { - "$path": "src/server" + "rapid-Server": { + "$className": "Actor", + "$path": "src/server" + } }, "ReplicatedFirst": { "$path": "src/load" diff --git a/src/client/Player/init.client.lua b/src/client/Player/init.client.lua index fecc2d2..86121ba 100644 --- a/src/client/Player/init.client.lua +++ b/src/client/Player/init.client.lua @@ -9,9 +9,9 @@ local HealthSettings = require(UI:WaitForChild("Health")) local CoreGuis = require(script:WaitForChild("CoreGuis")) local Mouse = require(script:WaitForChild("Mouse")) -local Players: Players = game:GetService("Players") +local Players: Players = game:GetService("Players") local Storage: ReplicatedStorage = game:GetService("ReplicatedStorage") -local RS: RunService = game:GetService("RunService") +local RS: RunService = game:GetService("RunService") local ClientStorage = Storage:WaitForChild("Client") local LoadCompleted = ClientStorage:WaitForChild("LoadingComplete") diff --git a/src/server/Studio/Lighting/Sky.lua b/src/server/Studio/Lighting/Sky.lua deleted file mode 100644 index 21ed0ab..0000000 --- a/src/server/Studio/Lighting/Sky.lua +++ /dev/null @@ -1,53 +0,0 @@ ---!optimize 2 ---!native ---!strict - -local function Sky(): Sky - local SkyBox = Instance.new("Sky") - SkyBox.MoonAngularSize = 8 - SkyBox.MoonTextureId = "rbxassetid://62326944" - SkyBox.SkyboxBk = "rbxassetid://9544505500" - SkyBox.SkyboxDn = "rbxassetid://9544547905" - SkyBox.SkyboxFt = "rbxassetid://9544504852" - SkyBox.SkyboxLf = "rbxassetid://9544547694" - SkyBox.SkyboxRt = "rbxassetid://9544547542" - SkyBox.SkyboxUp = "rbxassetid://9544547398" - SkyBox.SunTextureId = "rbxassetid://5392574622" - SkyBox.StarCount = 200 - SkyBox.SunAngularSize = 9 - - return SkyBox -end - -local function Atmosphere(): Atmosphere - local Atmosp = Instance.new("Atmosphere") - Atmosp.Density = .25 - Atmosp.Offset = 0 - Atmosp.Color = Color3.fromRGB(199, 199, 199) - Atmosp.Decay = Color3.fromRGB(106, 112, 125) - - return Atmosp -end - -local function Clouds(): Clouds - local _Clouds = Instance.new("Clouds") - _Clouds.Cover = .7 - _Clouds.Density = .15 - _Clouds.Color = Color3.fromRGB(180,180,180) - - return _Clouds -end - -export type exports = { - Sky: () -> Sky, - Atmosphere: () -> Atmosphere, - Clouds: () -> Clouds, -} - -local export: exports = { - Sky = Sky, - Atmosphere = Atmosphere, - Clouds = Clouds -} - -return export \ No newline at end of file diff --git a/src/server/Studio/EditorEntities.lua b/src/server/main/EditorEntities.lua similarity index 100% rename from src/server/Studio/EditorEntities.lua rename to src/server/main/EditorEntities.lua diff --git a/src/server/Elevators/Floors.lua b/src/server/main/Elevators/Floors.lua similarity index 100% rename from src/server/Elevators/Floors.lua rename to src/server/main/Elevators/Floors.lua diff --git a/src/server/Elevators/Leveling.lua b/src/server/main/Elevators/Leveling.lua similarity index 100% rename from src/server/Elevators/Leveling.lua rename to src/server/main/Elevators/Leveling.lua diff --git a/src/server/Elevators/Mover.lua b/src/server/main/Elevators/Mover.lua similarity index 100% rename from src/server/Elevators/Mover.lua rename to src/server/main/Elevators/Mover.lua diff --git a/src/server/Elevators/Otis1960/Doors.lua b/src/server/main/Elevators/Otis1960/Doors.lua similarity index 100% rename from src/server/Elevators/Otis1960/Doors.lua rename to src/server/main/Elevators/Otis1960/Doors.lua diff --git a/src/server/Elevators/Otis1960/main.server.lua b/src/server/main/Elevators/Otis1960/main.lua similarity index 64% rename from src/server/Elevators/Otis1960/main.server.lua rename to src/server/main/Elevators/Otis1960/main.lua index 277541a..22a0b49 100644 --- a/src/server/Elevators/Otis1960/main.server.lua +++ b/src/server/main/Elevators/Otis1960/main.lua @@ -2,20 +2,25 @@ --!native --!strict +local Otis1960_main = {} +Otis1960_main.__index = Otis1960_main + local Elevator = script.Parent -local Elevators = (Elevator :: Instance).Parent +local Elevators = Elevator.Parent local RS = game:GetService("ReplicatedStorage") -local Tags = require(RS:WaitForChild("Tags")) -local Leveling = require(Elevators:WaitForChild("Leveling")) -local Doors = require(Elevator:WaitForChild("Doors")) +local TagsModule = require(RS:WaitForChild("Tags")) +local Leveling = require(Elevators:WaitForChild("Leveling")) +local Doors = require(Elevator:WaitForChild("Doors")) local ElevatorMover = require(Elevators:WaitForChild("Mover")) -local ElevatorBox_1960 = Tags.ElevatorMover_1960 -local ElevatorBox = Tags.ElevatorMover_1960 :: BasePart -local ElevatorDoor1 = Tags.ElevatorDoor_1960_1 :: BasePart -local ElevatorDoor2 = Tags.ElevatorDoor_1960_2 :: BasePart +local Tags = TagsModule.constructor().Exports + +local ElevatorBox_1960 = Tags.ElevatorMover_1960 +local ElevatorBox = Tags.ElevatorMover_1960 :: BasePart +local ElevatorDoor1 = Tags.ElevatorDoor_1960_1 :: BasePart +local ElevatorDoor2 = Tags.ElevatorDoor_1960_2 :: BasePart local ElevatorDoorSensor = Tags.ElevatorDoor_Sensor_1960 :: Folder local ElevatorBoxStartPos = ElevatorBox_1960.Position @@ -44,4 +49,6 @@ print("[DEBUG]: Tags:",Tags) -- ElevatorDoors:Opening(true) -- task.wait(2) -- ElevatorDoors:Opening(false) --- end \ No newline at end of file +-- end + +return Otis1960_main \ No newline at end of file diff --git a/src/server/Studio/Lighting/init.lua b/src/server/main/Lighting/init.lua similarity index 83% rename from src/server/Studio/Lighting/init.lua rename to src/server/main/Lighting/init.lua index 2bc0527..e60f05a 100644 --- a/src/server/Studio/Lighting/init.lua +++ b/src/server/main/Lighting/init.lua @@ -3,9 +3,6 @@ --!strict local Lighting = game:GetService("Lighting") -local Terrain = workspace:WaitForChild("Terrain") - -local Sky = require(script:WaitForChild("Sky")) type LightingProps = { [string]: Color3 | number | boolean | string } @@ -33,9 +30,6 @@ export type Effects = { } return function(): Effects - Lighting:ClearAllChildren() - Terrain:ClearAllChildren() - --VFX Effects for later local ColorCorrection = Instance.new("ColorCorrectionEffect") ColorCorrection.Parent = Lighting @@ -49,10 +43,6 @@ return function(): Effects end end - Sky.Sky().Parent = Lighting - Sky.Atmosphere().Parent = Lighting - Sky.Clouds().Parent = Terrain - return { ColorCorrection = ColorCorrection } diff --git a/src/server/Studio/StarterPlayer.lua b/src/server/main/StarterPlayer.lua similarity index 100% rename from src/server/Studio/StarterPlayer.lua rename to src/server/main/StarterPlayer.lua diff --git a/src/server/Studio/Workspace.lua b/src/server/main/Workspace.lua similarity index 100% rename from src/server/Studio/Workspace.lua rename to src/server/main/Workspace.lua diff --git a/src/server/Studio/init.server.lua b/src/server/main/init.server.lua similarity index 72% rename from src/server/Studio/init.server.lua rename to src/server/main/init.server.lua index 99b66a1..b3266e9 100644 --- a/src/server/Studio/init.server.lua +++ b/src/server/main/init.server.lua @@ -7,9 +7,16 @@ local Lighting_Stuff = require(script:WaitForChild("Lighting")) local Workspace_Stuff = require(script:WaitForChild("Workspace")) local StarterPlayer_Stuff = require(script:WaitForChild("StarterPlayer")) -local RS = game:GetService("RunService") +local RS = game:GetService("RunService") local Storage = game:GetService("ReplicatedStorage") +local TagsModule = require(Storage:WaitForChild("Tags")) + +local TagsConstructor = TagsModule.constructor() +local Tags = TagsConstructor.Exports +print("[DEBUG] Tags=", Tags) + +local Elevators = script:WaitForChild("Elevators") local ServerStorage = Storage:WaitForChild("Server") local EditorEntities = Instance.new("BindableFunction") @@ -24,4 +31,6 @@ Workspace_Stuff() EditorEntities.OnInvoke = function(): HideEditorEntities.Entities return StudioEntities.IndexedEntities -end \ No newline at end of file +end + +TagsConstructor:Nuke() \ No newline at end of file diff --git a/src/shared/Client/KeyBinds.lua b/src/shared/Client/KeyBinds.lua index 1251512..8d54570 100644 --- a/src/shared/Client/KeyBinds.lua +++ b/src/shared/Client/KeyBinds.lua @@ -12,15 +12,16 @@ export type KeyBindMap = { [Enum.KeyCode]: (KeyPressed: Enum.KeyCode) -> () } } -export type InputBegan = RBXScriptConnection -export type InputEnded = RBXScriptConnection -type CallbackFunction = () -> () type BindConstructor = { BindMap: KeyBindMap, InputBegan: InputBegan, InputEnded: InputEnded } +export type InputBegan = RBXScriptConnection +export type InputEnded = RBXScriptConnection +type CallbackFunction = (KeyPressed: Enum.KeyCode) -> () + local UIS = game:GetService("UserInputService") function BindLink.constructor(gameProcessing: boolean) --Allow multiple bindings of the same keys, no overwrites diff --git a/src/shared/Tags.lua b/src/shared/Tags.lua index c961a56..b56f34b 100644 --- a/src/shared/Tags.lua +++ b/src/shared/Tags.lua @@ -2,17 +2,44 @@ --!native --!strict +local Tags = {} +Tags.__index = Tags + local CS = game:GetService("CollectionService") -local exports: {[string]: Instance} = {} +type ExportedTags = { + [string]: Instance | {Instance} +} -local AllTags = CS:GetAllTags() -for i = 1, #AllTags do - local TagName = AllTags[i] - if TagName ~= "RopeMasterObject" and TagName ~= "ServerGuard_Physics" then - local Tagged = CS:GetTagged(TagName) - exports[TagName] = #Tagged>1 and Tagged or Tagged[1] +function Tags.constructor() + local Exports: ExportedTags = {} + local AllTags = CS:GetAllTags() + + for n: number = 1, #AllTags do + local TagName = AllTags[n] + if TagName ~= "RopeMasterObject" and TagName ~= "ServerGuard_Physics" then + local Tagged = CS:GetTagged(TagName) + Exports[TagName] = #Tagged>1 and Tagged or Tagged[1] + end end + return setmetatable({ + Exports = Exports + }, Tags) end -return exports \ No newline at end of file +function Tags:Nuke() + local Exports = self.Exports + + for i,v in Exports do + if type(v) == "table" then + for n: number = 1, #v do + CS:RemoveTag(v[n], i) + end + else + CS:RemoveTag(v, i) + end + end + warn("☢️ nuked all in-game tags. Left-over tags="..table.concat(CS:GetAllTags(), ", ")) +end + +return Tags \ No newline at end of file