Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to add the (WaitForChild) to this to make it work?

The first script is "PowerOutage" and the below one is "Gate"

local m = Instance.new("Hint", game.Workspace)
 m.Text = "Main Computer Offline!"
 m.Name = "Offline"
	game.Workspace.Gate.PowerOutage.PowerOutageSound:play()
	game.Lighting.TimeOfDay = 0
	game.Lighting.Brightness = 0
	game.Lighting.Ambient = Color3.new (0, 0, 0)
wait(3)
m:remove()

What do I add to this script below to make the script above work? The above script is in the properties of the bottom script and is not local, and is in the workspace. Also filtering is disabled. Everything in the above script works EXCEPT for the parts that adjust the lighting. The lighting part of the script only works in testing, but not actually in a server.

script.AnnouncementsSafe:Play()
wait(4)
script.ReactorSafe2:Play()
wait(6)
script.Alarmy:play()
wait(20)
script.music1:play()
wait(3)
script.Beginning:play()
wait(20)
script.emgevac:Play()
wait(18)
script.emgevac:Play()
wait(15)
script.explosionimminent:Play()
wait(7)
script.emgevac:Play()
wait(20)
wait(2)
script.actionmusic:Play()
wait(3)
script.firemergency:Play()
wait(10)
script.emergencypower:Play()
wait(7)
script.coreexplosionimminent:Play()
wait(9)
wait(11)
script.firemergency:Play()
wait(17)
script.fourminutes:Play()
wait(1)
wait(3)
script.nuclearalarm:Play()
script.actionmusic:Stop()
script.matrix1:Play()
wait(15)
local m = Instance.new("Hint", game.Workspace)
 m.Text = "Evacuate Starbase - IMMEDIATELY! "
 m.Name = "Evac"
wait(11)
wait(4.2)
m:remove()
-- SCRIPT ABOVE ENABLED BELOW --
game.Workspace.Gate.PowerOutage.Disabled = false
local m = Instance.new("Hint", game.Workspace)
 m.Text = "MAIN COMPUTER OFFLINE! - NO POWER"
 m.Name = "OUTAGE"
wait(15)
m:remove()
local m = Instance.new("Hint", game.Workspace)
 m.Text = "Evacuate Starbase - IMMEDIATELY ! "
 m.Name = "Evac"
wait(19)
wait(39)
m:Remove()
script.timerdestroyed:Play()
wait(9)
script.selfdestruct:Play()
wait(8)
script.alarmmain2:Play()
local msg = Instance.new("Message")
msg.Parent = game.Workspace
msg.Name = 'HelloBrick'
msg.Text = "Warning - Computer Self Destruct Initiated"
wait(5)
msg.Text = "Have a wonderful day :)"
wait(3)  
game.Workspace.HelloBrick:Remove()
script.matrix1:Stop()
script.matrix2:Play()
script.Countdown.Disabled = false

1 comment

0

you can try putting wait() before everything or if you wan't it to look "pretty" you can do :WaitForChild("Lighting")

1 answer

In order to do a WaitForChild you simply use:

local Lighting = game:WaitForChild("Lighting")
Lighting.TimeOfDay = 0
Lighting.Brightness = 0

2 comments

0

Okay, thanks! do you think this will fix the problem, and allow the lighting script to work in a server too? It currently only works in testing

0

I tried adding this and nothing happened..

This discussion is preserved as it was. New answers, comments, and votes are closed.