mirror of
https://github.com/unixtensor/Roblox-Elevator-Game.git
synced 2025-12-14 14:51:55 +00:00
remove scripts that are not part of the framework
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
--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
|
||||||
|
|
||||||
|
local Players = game:GetService("Players")
|
||||||
|
|
||||||
export type Entities = {
|
export type Entities = {
|
||||||
IndexedEntities: {Instance}
|
IndexedEntities: {Instance}
|
||||||
}
|
}
|
||||||
@@ -38,9 +40,20 @@ function StudioEntities.indexAll(enabled: boolean): Entities
|
|||||||
Case(Item, enabled)
|
Case(Item, enabled)
|
||||||
end
|
end
|
||||||
|
|
||||||
--Do micro optimizations here
|
if Item:IsA("BasePart") then --Do micro optimizations
|
||||||
if Item:IsA("BasePart") then
|
|
||||||
Item.CanTouch = false
|
Item.CanTouch = false
|
||||||
|
elseif Item:IsA("LuaSourceContainer") then --Cant allow scripts outside of the framework
|
||||||
|
--mini algorthim to see if the script is part of the rhpid-framework character or not
|
||||||
|
local Model = Item:FindFirstAncestorOfClass("Model")
|
||||||
|
|
||||||
|
if not Players:GetPlayerFromCharacter(Model) then
|
||||||
|
local Path = Item:GetFullName()
|
||||||
|
pcall(function()
|
||||||
|
Item.Enabled = false
|
||||||
|
end)
|
||||||
|
Item:Destroy()
|
||||||
|
warn(`Script: "{Item.Name}" ({Item.ClassName}) was removed because it was outside of the rhpid-framework boundries,`, Path)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user