local Maps = game.ReplicatedStorage.Experiments
local module = {}
module.LoadExperiment = function(map)
local ExistentExperiment = game.Workspace:FindFirstChild("ExperimentCurrent")
if ExistentExperiment then
ExistentExperiment:Destroy()
end
local Experiment = Maps[map]:Clone()
Experiment.Parent = workspace
Experiment.Name = "ExperimentCurrent"
end
return module
I have tried using remoteevents but it broke with the same error.
local mod = require(path to mod)
-- Errors, we gave it a table but [] needs a string. It's like saying Maps[{table}]
mod.LoadExperiment({"Map1", "Map2"})
-- Works fine, it's like saying Maps["Map1"]
mod.LoadExperiment("Map1")
Can we see the script using the module and calling LoadExperiment?