Alright so, I would like set to the scripts inside a model (which is parented to workspace) to Disabled = false when an event is fired, however I am stuck on how I would access these scripts using a for loop.
I currently have the script below but it doesn't seem to work.
Any help would greatly be appreciated!
--There are other pieces of code above
event3.OnInvoke = function()
local AIScripts = game.workspace:GetDescendants()
for i=1, #AIScripts do
if AIScripts[i]:IsA("Model") then
if AIScripts[i].Name == "AI" then
if AIScripts[i]:IsA("Script") then
AIScripts[i].Disabled = false
end
end

1 comment
Use :GetDescendants()