It only enables the particles, not the light.
Also, nothing disables when I try.
Script:
repStore.SpellEvents.FlameRitual.OnServerEvent:Connect(function()
if game.Workspace.Altar.IsActive.Value == true then
for _,l in pairs(game.Workspace.Flames:GetChildren()) do
if l:IsA("ParticleEmitter") then
l.Enabled = true
if l:IsA("SurfaceLight") then
l.Enabled = true
wait(5)
l.Enabled = false
end
end
end
end
end)
local script:
elseif string.find(msg:lower(),"flammare") ~= nil and debounce == false then
debounce = true
event3:FireServer()
wait(5)
debounce = false
end
end)
There is more to the scripts, these are just parts that I am having the issue with
repStore.SpellEvents.FlameRitual.OnServerEvent:Connect(function()
if game.Workspace.Altar.IsActive.Value == true then
for _,l in pairs(game.Workspace.Flames:GetChildren()) do
if l:IsA("ParticleEmitter") then
l.Enabled = true
elseif l:IsA("SurfaceLight") then
l.Enabled = true
wait(5)
l.Enabled = false
end
end
end
end)
Have you tried adding a print after the if statement?
repStore.SpellEvents.FlameRitual.OnServerEvent:Connect(function()
if game.Workspace.Altar.IsActive.Value == true then
for _,l in pairs(game.Workspace.Flames:GetChildren()) do
if l:IsA("ParticleEmitter") then
l.Enabled = true
elseif l:IsA("SurfaceLight") then
print("Surface light found!")
l.Enabled = true
wait(5)
l.Enabled = false
end
end
end
end)
this is just to see if it even passes the if statement
I also tried to recreate the issue but it works fine according to my prints.
I noticed the particle emitters won’t disable so this is an updated script:
repStore.SpellEvents.FlameRitual.OnServerEvent:Connect(function()
if game.Workspace.Altar.IsActive.Value == true then
for _,l in pairs(game.Workspace.Flames:GetChildren()) do
if l:IsA("ParticleEmitter") then
l.Enabled = true
wait(5)
l.Enabled = false
elseif l:IsA("SurfaceLight") then
print("Surface light found!")
l.Enabled = true
wait(5)
l.Enabled = false
end
end
end
end)