Currently im working on trying to get PointLights and SpotLights to change color/brightness. My problem is im using a for loop to loop through the model I made and then trying to change the brightness to 0 and then changing the lights to red but then the lights dont change at all.
local FIred = game.ReplicatedStorage.Jumpscare1
local debounce = false
FIred.OnClientEvent:Connect(function()
if debounce == false then
for i,v in pairs (workspace.Train1.Model:GetDescendants()) do
if v:IsA("Part") or v:IsA("Decal") then
v.Transparency = 0
script.Parent.Scream:Play()
end
end
wait(2)
------------------------------------------------------------------------------------------------------- Not working
for i,v in pairs (workspace.Train1:GetDescendants()) do
if v:IsA("SpotLight") or v:IsA("PointLight") then
v.Brightness = 0
game.StarterGui.Electricity_surge:Play()
wait(5)
workspace.Train1.Model:Destroy()
wait(0.05)
game.StarterGui.Electricity_Up:Play()
v.Brightness = 5
-------------------------------------------------------------------------------------------------------
end
end
end
end)