I'm making a Self-Destruct System for my new game, but the music isn't playing when ordered and the output isn't saying anything. Here is the code I tried:
--Functions--
function MakeTextVisible()
script.TextTransparency.Value = 0.9
wait(0.05)
script.TextTransparency.Value = 0.8
wait(0.05)
script.TextTransparency.Value = 0.7
wait(0.05)
script.TextTransparency.Value = 0.6
wait(0.05)
script.TextTransparency.Value = 0.5
wait(0.05)
script.TextTransparency.Value = 0.4
wait(0.05)
script.TextTransparency.Value = 0.3
wait(0.05)
script.TextTransparency.Value = 0.2
wait(0.05)
script.TextTransparency.Value = 0.1
wait(0.05)
script.TextTransparency.Value = 0
end
function MakeTextInvisible()
script.TextTransparency.Value = 0.1
wait(0.05)
script.TextTransparency.Value = 0.2
wait(0.05)
script.TextTransparency.Value = 0.3
wait(0.05)
script.TextTransparency.Value = 0.4
wait(0.05)
script.TextTransparency.Value = 0.5
wait(0.05)
script.TextTransparency.Value = 0.6
wait(0.05)
script.TextTransparency.Value = 0.7
wait(0.05)
script.TextTransparency.Value = 0.8
wait(0.05)
script.TextTransparency.Value = 0.9
wait(0.05)
script.TextTransparency.Value = 1
end
--Script--
script.Parent.MouseClick:Connect(function(click)
if script.Running.Value == false and script.Parent.Parent.Parent.CoreComputer.SurfaceGui.Computer.PowerStatus.Power.Value == 100 then
script.Clicker.Value = click.Name
local Time = math.random(1,70)
local Song = math.random(1,1)
workspace.ControlRods.Height.Value = -73
wait(0.25)
workspace.ControlRods.Height.Value = -72
wait(0.25)
workspace.ControlRods.Height.Value = -71
wait(0.25)
workspace.ControlRods.Height.Value = -70
wait(0.25)
workspace.ControlRods.Height.Value = -69
workspace.CoreComputer.SurfaceGui.Computer.ControlRods.Text = "Control Rods Active: 0/126"
workspace.Alarms.EmergencyLight1.Alarm1:Play()
wait(2)
workspace.Alarms.EmergencyLight1.Announcement:Play()
wait(2.25)
game.SoundService.SelfDestruct.Song1:Play()
MakeTextVisible()
wait(0.1)
script.Narration.Value = script.Clicker.Value.." has activated the Energy Core Self Destruct System!"
wait(3)
MakeTextInvisible()
wait(0.1)
script.Narration.Value = "An Escape Helicopter has landed on the Mountain! Find it to Escape the Self-Destruct System!"
wait(0.1)
MakeTextVisible()
wait(3)
script.Narration.Value = "Facility about to Explode; escape Helicopter leaves in "..Time.." seconds!"
repeat
wait(1)
Time = Time -1
script.Narration.Value = "Facility about to Explode; escape Helicopter leaves in "..Time.." seconds!"
until Time == 0
script.Narration.Value = "Escape Helicopter is leaving!"
MakeTextInvisible()
game.SoundService.SelfDestruct.PrimarySongs.Song1.Volume = 0.4
wait(0.25)
game.SoundService.SelfDestruct.PrimarySongs.Song1.Volume = 0.3
wait(0.25)
game.SoundService.SelfDestruct.PrimarySongs.Song1.Volume = 0.2
wait(0.25)
game.SoundService.SelfDestruct.PrimarySongs.Song1.Volume = 0.
wait(0.25)
game.SoundService.SelfDestruct.PrimarySongs.Song1.Volume = 0
end
end)
Don't worry about it all, all I want you to worry about is line 67, aka, this line:
game.SoundService.SelfDestruct.Song1:Play()
I would appreciate some help! Thanks! -JBennettChief9
