mirror of
https://github.com/unixtensor/Roblox-Elevator-Game.git
synced 2025-12-15 21:31:54 +00:00
types and sound editor entity
This commit is contained in:
@@ -4,12 +4,14 @@
|
||||
|
||||
--All debugging objects such as light source indicating objects will be turned invisible
|
||||
|
||||
export type Entities = {IndexedEntities: {Instance}}
|
||||
|
||||
type HideEditor = (a1: BasePart | Folder, a2: boolean) -> ()
|
||||
type LuaChangeableContainer = Script | LocalScript
|
||||
|
||||
local Players = game:GetService("Players")
|
||||
local CS = game:GetService("CollectionService")
|
||||
|
||||
export type Entities = {
|
||||
IndexedEntities: {Instance}
|
||||
}
|
||||
local StudioEntities = {
|
||||
IndexedEntities = {}
|
||||
}
|
||||
@@ -20,6 +22,19 @@ local function HidePart(Part: BasePart, enabled: boolean)
|
||||
Part.CastShadow = false
|
||||
end
|
||||
|
||||
local function HideIndicatorPart(Part: BasePart, enabled: boolean)
|
||||
local billboard_light_indicator = Part:FindFirstChildOfClass("BillboardGui")
|
||||
if billboard_light_indicator then
|
||||
if enabled then
|
||||
billboard_light_indicator:Destroy()
|
||||
end
|
||||
else
|
||||
warn("Indicator source had no image indicator", Part:GetFullName())
|
||||
end
|
||||
|
||||
HidePart(Part, enabled)
|
||||
end
|
||||
|
||||
local function HideBarrierCollision(Part: BasePart, enabled: boolean)
|
||||
Part.Transparency = enabled and 1 or .9
|
||||
Part.CastShadow = false
|
||||
@@ -30,12 +45,8 @@ local function HideRaycastContainers(Folder: Folder, enabled: boolean)
|
||||
local End = Folder:WaitForChild("End") :: BasePart
|
||||
local Start = Folder:WaitForChild("Start") :: BasePart
|
||||
|
||||
End.CanCollide = false
|
||||
End.CastShadow = false
|
||||
End.Transparency = enabled and 1 or .9
|
||||
Start.CanCollide = false
|
||||
Start.CastShadow = false
|
||||
Start.Transparency = enabled and 1 or .9
|
||||
HidePart(Start, enabled)
|
||||
HidePart(End, enabled)
|
||||
end
|
||||
|
||||
local function HideLadderContact(Part: BasePart, enabled: boolean)
|
||||
@@ -45,17 +56,15 @@ local function HideLadderContact(Part: BasePart, enabled: boolean)
|
||||
end
|
||||
|
||||
local EditorEntities = {
|
||||
["LightSource"] = HidePart,
|
||||
["LightSource"] = HideIndicatorPart,
|
||||
["SoundSource"] = HideIndicatorPart,
|
||||
["PulleyRopeContact"] = HidePart,
|
||||
["BarrierCollision"] = HideBarrierCollision,
|
||||
["StairSource"] = HideBarrierCollision,
|
||||
["RaycastContainer"] = HideRaycastContainers,
|
||||
["LadderContact"] = HideLadderContact
|
||||
["BarrierCollision"] = HideBarrierCollision,
|
||||
["StairSource"] = HideBarrierCollision,
|
||||
["RaycastContainer"] = HideRaycastContainers,
|
||||
["LadderContact"] = HideLadderContact,
|
||||
}
|
||||
|
||||
type HideEditor = (a1: BasePart | Folder, a2: boolean) -> ()
|
||||
type LuaChangeableContainer = Script | LocalScript
|
||||
|
||||
function StudioEntities.indexAll(enabled: boolean): Entities
|
||||
if #StudioEntities.IndexedEntities == 0 then
|
||||
--Run when the server starts
|
||||
|
||||
Reference in New Issue
Block a user