I want this script to be enabled whenever it is put into workspace.
The issue is, it’s not enabling at all but when I print the enabled property it says it is.
while true do wait(ChangeTypeTick)
local CurrentType = ZombieType.Value
--ZombieType.Value = Types[math.random(1,#Types)].Name
ZombieType.Value = "Void"
local Folder = TerrainTypes[ZombieType.Value]
local GrassColor = Folder:WaitForChild("GrassColor").Value
workspace.Terrain:SetMaterialColor(Enum.Material.Grass, Color3.new(GrassColor))
if Folder:FindFirstChild("Boss") then
local Boss = Bosses:FindFirstChild(ZombieType.Value)
local BossClone = Boss:Clone()
local ControlClone = ZombieControlScript:Clone()
BossClone:Clone().Parent = workspace
ControlClone.Parent = BossClone
ControlClone.Enabled = true
end
end
Though, One Question,
Why dont you Control the Zombies all Together instead of Separately?
Instead of having One Script per Zombie, you can have one Script for all, Which is Simple to make.
local CurrentType = ZombieType.Value
--ZombieType.Value = Types[math.random(1,#Types)].Name
ZombieType.Value = "Void"
local Folder = TerrainTypes[ZombieType.Value]
local GrassColor = Folder:WaitForChild("GrassColor").Value
workspace.Terrain:SetMaterialColor(Enum.Material.Grass, Color3.new(GrassColor))
if Folder:FindFirstChild("Boss") then
local Boss = Bosses:FindFirstChild(ZombieType.Value)
local BossClone = Boss:Clone()
local ControlClone = ZombieControlScript:Clone()
BossClone:Clone().Parent = workspace
ControlClone.Parent = BossClone
ControlClone.Enabled = false
ControlClone.Enabled = true
end
end