I’m developing a game and I was planning to do a blackout and the part I didn’t know how to do was change the color from white to black as if they were off. I tried to look elsewhere for help but it didn’t work, so I came here.
My script here:
llocal teamM = game.Teams["Afternation inc"]
local teamM = game.Teams["Cívis"]
local ProximityPromptService = game:GetService("ProximityPromptService")
local LiBool = script.Parent.Parent.Parent.Parent.Parent.Lights
local Gene2 = script.Parent.Parent.Parent.Parent.Big
local Gene = script.Parent.Parent.Parent.Parent.Gene
local Promp = script.Parent.Parent.ProximityPrompt
local SemPromp = script.Parent.Parent
local BombPro = script.Parent.Parent.Parent.Bomb
local Bomb = script.Parent.Parent.Parent.BombExplosive
local Light1 = script.Parent.Parent.Parent.BombExplosive.PointLight
local Smoke = script.Parent.Parent.Parent.BombExplosive.Smoke
local Sound = script.Parent.Parent.Parent.BombExplosive.Sound
local SoundExplo = script.Parent.Parent.Parent.BombExplosive.SoundExplosion
local Proxi = script.Parent.Parent.ProximityPrompt
script.Parent.Parent.ProximityPrompt.Triggered:Connect(function(player)
if player.Team == teamM then
Promp.Enabled = false
Bomb.Transparency = 0
Bomb.CanCollide = true
BombPro.Transparency = 1
Sound:Play()
Light1.Enabled = true
wait(0.5)
Light1.Enabled = false
wait(0.5) --1
Light1.Enabled = true
wait(0.5) --1,5
Light1.Enabled = false
wait(0.5) --2
Light1.Enabled = true
wait(0.5)
Light1.Enabled = false
wait(0.5) --3
Light1.Enabled = true
wait(0.5)
Light1.Enabled = false
wait(0.5) --4
Light1.Enabled = true
wait(0.5)
Light1.Enabled = false
wait(0.5) --5
Light1.Enabled = true
wait(0.5)
Light1.Enabled = false
wait(0.5) --6
Light1.Enabled = true
wait(0.5)
Light1.Enabled = false
wait(0.5) --7
Light1.Enabled = true
wait(0.5)
Light1.Enabled = false
wait(0.5) --8
Light1.Enabled = true
wait(0.5) ---0,5
Smoke.Enabled = true
wait(0.5) --1
wait(0.5) --1,5
wait(0.5) --2
Light1.Enabled = false
SoundExplo:Play()
Bomb.CanCollide = false
Bomb.Transparency = 1
wait(3)
Smoke.Enabled = false
Gene.Material = Enum.Material.CorrodedMetal
Gene2.Material = Enum.Material.CorrodedMetal
LiBool.Value = true
end
end)
for i,brick in ipairs(workspace:GetChildren()) do
if brick:IsA("Part") and brick.Name == "Light" then
SemPromp.ProximityPrompt.Triggered(function(obj)
if LiBool.Value == true then
brick.BrickColor = BrickColor.new("Black")
end
end)
end
end