Alright, so my problem is that my holo script won't work; I'm gonna dump all relevant information here and hope someone can help me.
Object Hierarchy:
-Game
- Workspace
- Holo System
- Computer
- Aurum's Holo Script
- Functions (modulescript)
- Maps (another modulescript)
- Generator
- Humanoid
- Torso
- SelectionBox
- Connection (this is a selectionpartlasso)
- Replicated Storage
- Cabin (the holo map)
Code in main holo script
Maps = require(script.Maps)
Functions = require(script.Functions)
wait(2)
Functions.StartSim(Maps.Cabin)
wait(10)
Functions.EndSim()
Code in "Functions" ModuleScript
local Selectors = {
game.Workspace["Holo System"].Generator.SelectionBox;
game.Workspace["Holo System"].Generator.Connection
}
local Functions = {}
Functions.StartSim = function(Map)
local Simulation = Instance.new("Model", game.Workspace)
Simulation.Name = "Simulation"
for _,v in pairs(Selectors) do
v.Visible = true
end
for _,v in pairs(Map:GetChildren()) do
v.Parent = Simulation
for _,c in pairs(Selectors) do
if c:IsA("SelectionBox") then
c.Adornee = v
elseif c:IsA("SelectionPartLasso") then
c.Part = v
end
end
wait()
for _,c in pairs(Selectors) do
if c:IsA("SelectionBox") then
c.Adornee = nil
elseif c:IsA("SelectionPartLasso") then
c.Part = nil
end
end
end
for _,v in pairs(Selectors) do
v.Visible = false
end
end
Functions.EndSim = function()
local Simulation = game.Workspace:FindFirstChild("Simulation")
for _,v in pairs(Selectors) do
v.Visible = true
end
for _,v in pairs(Simulation:GetChildren()) do
for _,c in pairs(Selectors) do
if c:IsA("SelectionBox") then
c.Adornee = v
elseif c:IsA("SelectionPartLasso") then
c.Part = v
end
end
wait()
for _,c in pairs(Selectors) do
if c:IsA("SelectionBox") then
c.Adornee = nil
elseif c:IsA("SelectionPartLasso") then
c.Part = nil
end
v:Destroy()
end
end
for _,v in pairs(Selectors) do
v.Visible = false
end
end
return Functions
Code in "Maps" ModuleScript
local Maps = {
Cabin = game.ReplicatedStorage.Cabin
}
return Maps
Any and all help appreciated.
Thanks in advance, AurumAquila
