Skip to content

Commit

Permalink
feat: ability to exclude instances descendants from being added as li…
Browse files Browse the repository at this point in the history
…ghts
  • Loading branch information
parker02311 committed Feb 23, 2025
1 parent 02d6973 commit fc98182
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- Support for AG-Chassis built in Stages, Traffic Advisor, and Scene events
- Ability to exclude models/folders lights from being loaded

### Fixed

Expand Down
17 changes: 17 additions & 0 deletions src/handler/EVHEvent/loader/init.server.luau
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,25 @@ local function load()
end
end

local exclusionParents = {}
for _, possibleExclusion in car:GetDescendants() do
if possibleExclusion:GetAttribute("EVH_Ignore") == true then
table.insert(exclusionParents, possibleExclusion)
end
end

for _, light in car:GetDescendants() do
if light:IsA("BasePart") then
local excluded = false
for _, exclusionParent in exclusionParents do
if light:IsDescendantOf(exclusionParent) then
excluded = true
break
end
end
if excluded then
continue
end
if table.find(possibleLights, light.Name) ~= nil then
light:AddTag(`{uuid}_LIGHT`)
if lightTemplate ~= nil then
Expand Down

0 comments on commit fc98182

Please sign in to comment.