mirror of
https://github.com/unixtensor/Roblox-Elevator-Game.git
synced 2025-12-14 14:51:55 +00:00
types and sound editor entity
This commit is contained in:
@@ -2,16 +2,17 @@
|
|||||||
--!native
|
--!native
|
||||||
--!strict
|
--!strict
|
||||||
|
|
||||||
local Flashlight = {}
|
|
||||||
Flashlight.__index = Flashlight
|
|
||||||
|
|
||||||
type UDP = UnreliableRemoteEvent
|
type UDP = UnreliableRemoteEvent
|
||||||
type FlashlightUDP = RBXScriptConnection
|
type FlashlightUDP = RBXScriptConnection
|
||||||
type LocalPlayer = Player
|
type LocalPlayer = Player
|
||||||
type HumanoidRootPart = BasePart
|
type HumanoidRootPart = BasePart
|
||||||
|
|
||||||
type EulerXYZ_struct = {number}
|
type EulerXYZ_struct = {number}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
local Flashlight = {}
|
||||||
|
Flashlight.__index = Flashlight
|
||||||
|
|
||||||
Flashlight.Enabled = false
|
Flashlight.Enabled = false
|
||||||
Flashlight.HeadHeight = 1
|
Flashlight.HeadHeight = 1
|
||||||
|
|
||||||
@@ -45,7 +46,7 @@ local function FlashlightPart(HumanoidRootPart: HumanoidRootPart): (Part, SpotLi
|
|||||||
ToggleSound.Name = "Flashlight"
|
ToggleSound.Name = "Flashlight"
|
||||||
ToggleSound.SoundId = "rbxassetid://16454678462"
|
ToggleSound.SoundId = "rbxassetid://16454678462"
|
||||||
ToggleSound.Volume = .5
|
ToggleSound.Volume = .5
|
||||||
ToggleSound.Parent = HumanoidRootPart
|
ToggleSound.Parent = FlashlightPart
|
||||||
|
|
||||||
FlashlightPart.Parent = HumanoidRootPart
|
FlashlightPart.Parent = HumanoidRootPart
|
||||||
|
|
||||||
|
|||||||
@@ -4,12 +4,14 @@
|
|||||||
|
|
||||||
--All debugging objects such as light source indicating objects will be turned invisible
|
--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 Players = game:GetService("Players")
|
||||||
local CS = game:GetService("CollectionService")
|
local CS = game:GetService("CollectionService")
|
||||||
|
|
||||||
export type Entities = {
|
|
||||||
IndexedEntities: {Instance}
|
|
||||||
}
|
|
||||||
local StudioEntities = {
|
local StudioEntities = {
|
||||||
IndexedEntities = {}
|
IndexedEntities = {}
|
||||||
}
|
}
|
||||||
@@ -20,6 +22,19 @@ local function HidePart(Part: BasePart, enabled: boolean)
|
|||||||
Part.CastShadow = false
|
Part.CastShadow = false
|
||||||
end
|
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)
|
local function HideBarrierCollision(Part: BasePart, enabled: boolean)
|
||||||
Part.Transparency = enabled and 1 or .9
|
Part.Transparency = enabled and 1 or .9
|
||||||
Part.CastShadow = false
|
Part.CastShadow = false
|
||||||
@@ -30,12 +45,8 @@ local function HideRaycastContainers(Folder: Folder, enabled: boolean)
|
|||||||
local End = Folder:WaitForChild("End") :: BasePart
|
local End = Folder:WaitForChild("End") :: BasePart
|
||||||
local Start = Folder:WaitForChild("Start") :: BasePart
|
local Start = Folder:WaitForChild("Start") :: BasePart
|
||||||
|
|
||||||
End.CanCollide = false
|
HidePart(Start, enabled)
|
||||||
End.CastShadow = false
|
HidePart(End, enabled)
|
||||||
End.Transparency = enabled and 1 or .9
|
|
||||||
Start.CanCollide = false
|
|
||||||
Start.CastShadow = false
|
|
||||||
Start.Transparency = enabled and 1 or .9
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function HideLadderContact(Part: BasePart, enabled: boolean)
|
local function HideLadderContact(Part: BasePart, enabled: boolean)
|
||||||
@@ -45,17 +56,15 @@ local function HideLadderContact(Part: BasePart, enabled: boolean)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local EditorEntities = {
|
local EditorEntities = {
|
||||||
["LightSource"] = HidePart,
|
["LightSource"] = HideIndicatorPart,
|
||||||
|
["SoundSource"] = HideIndicatorPart,
|
||||||
["PulleyRopeContact"] = HidePart,
|
["PulleyRopeContact"] = HidePart,
|
||||||
["BarrierCollision"] = HideBarrierCollision,
|
["BarrierCollision"] = HideBarrierCollision,
|
||||||
["StairSource"] = HideBarrierCollision,
|
["StairSource"] = HideBarrierCollision,
|
||||||
["RaycastContainer"] = HideRaycastContainers,
|
["RaycastContainer"] = HideRaycastContainers,
|
||||||
["LadderContact"] = HideLadderContact
|
["LadderContact"] = HideLadderContact,
|
||||||
}
|
}
|
||||||
|
|
||||||
type HideEditor = (a1: BasePart | Folder, a2: boolean) -> ()
|
|
||||||
type LuaChangeableContainer = Script | LocalScript
|
|
||||||
|
|
||||||
function StudioEntities.indexAll(enabled: boolean): Entities
|
function StudioEntities.indexAll(enabled: boolean): Entities
|
||||||
if #StudioEntities.IndexedEntities == 0 then
|
if #StudioEntities.IndexedEntities == 0 then
|
||||||
--Run when the server starts
|
--Run when the server starts
|
||||||
|
|||||||
@@ -17,11 +17,9 @@ function Tags.constructor()
|
|||||||
|
|
||||||
for n: number = 1, #AllTags do
|
for n: number = 1, #AllTags do
|
||||||
local TagName = AllTags[n]
|
local TagName = AllTags[n]
|
||||||
if TagName ~= "RopeMasterObject" and TagName ~= "ServerGuard_Physics" then
|
|
||||||
local Tagged = CS:GetTagged(TagName)
|
local Tagged = CS:GetTagged(TagName)
|
||||||
Exports[TagName] = #Tagged>1 and Tagged or Tagged[1]
|
Exports[TagName] = #Tagged>1 and Tagged or Tagged[1]
|
||||||
end
|
end
|
||||||
end
|
|
||||||
return setmetatable({
|
return setmetatable({
|
||||||
Exports = Exports
|
Exports = Exports
|
||||||
}, Tags)
|
}, Tags)
|
||||||
|
|||||||
Reference in New Issue
Block a user