Hey there developers,
So, I have this LocalScript
in StarterPlayerScripts
and for some reason this weird thing that happend:
So, there is a line of code that specifies this:
local takeoff = game.Workspace.Nuke.Takeoff
takeoff.Parent = workspace
takeoff:Play()
and then there is a line of code that says this:
local boom = game.Workspace.Nuke.Boom
boom.Parent = workspace
boom:Play()
But for some reason, when I try playing the boom sound (second code) it plays the first line that is the sound of a jet taking off.
If you want the whole script, it’s down below:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteEvent = ReplicatedStorage.NukeEvent
local plrs = game:GetService("Players")
local plr = plrs.LocalPlayer
local function onClientReceive()
warn("The nuke has been launched!")
game.Workspace.Nuke.Missle.Base.Anchored = true
local debounce = false
if debounce == false then
debounce = true
local siren = game.Workspace.Nuke.Siren
siren.Parent = workspace
siren:Play()
local notif = game.Workspace.Nuke.Notification
notif.Parent = workspace
notif:Play()
plr.PlayerGui.NukeWarning.Enabled = true
coroutine.resume(coroutine.create(function()
local lights = game.Workspace.Nuke.Lights:GetChildren()
for i=1,25 do
for i,v in pairs(lights) do
v.SpotLight.Enabled = true
end
wait(1)
for i,v in pairs(lights) do
v.SpotLight.Enabled = false
end
wait(1)
end
end))
wait(3)
game.Workspace.Nuke.Missle.Base.Fire.Enabled = true
game.Workspace.Nuke.Missle.Base.Smoke.Enabled = true
local TweenService = game:GetService("TweenService")
local Door = workspace.Bunker.BunkerDoor
local goal = {}
goal.Position = Vector3.new(324.1, -7.05, 58.6)
local goaltwo = {}
goaltwo.Position = Vector3.new(324.1, 7.35, 58.6)
local tweenInfo = TweenInfo.new(3)
local open = TweenService:Create(Door, tweenInfo, goal)
local close = TweenService:Create(Door, tweenInfo, goaltwo)
open:Play()
game.Workspace.Bunker.BunkerDoor.Door:Play()
game.Workspace["Warhead Control Facility"].NukeTrapdoor.Union.Transparency = 1
game.Workspace["Warhead Control Facility"].NukeTrapdoor.Union2.Transparency = 1
local takeoff = game.Workspace.Nuke.Takeoff
takeoff.Parent = workspace
takeoff:Play()
wait(12)
local takeoffbang = game.Workspace.Nuke.TakeoffBang
takeoffbang.Parent = workspace
takeoffbang:Play()
game.Workspace.Nuke.Missle.PrimaryPart = game.Workspace.Nuke.Missle.Base
for i=1,320 do
game.Workspace.Nuke.Missle:SetPrimaryPartCFrame(game.Workspace.Nuke.Missle:GetPrimaryPartCFrame()+Vector3.new(0,0.05*((1.1^(i/5))/3),0))
wait()
end
wait()
close:Play()
game.Workspace.Bunker.BunkerDoor.Door:Play()
for i=1,100 do
game.Workspace.Nuke.Missle:SetPrimaryPartCFrame(game.Workspace.Nuke.Missle:GetPrimaryPartCFrame()+Vector3.new(0,0.05*(1.1^((250-i)/5)/3),0))
game.Workspace.Nuke.Missle:SetPrimaryPartCFrame(game.Workspace.Nuke.Missle:GetPrimaryPartCFrame()*CFrame.Angles(0,math.pi/100,0))
game.Workspace.Nuke.Missle:SetPrimaryPartCFrame(game.Workspace.Nuke.Missle:GetPrimaryPartCFrame()+Vector3.new(0,0,-i/100))
wait()
end
wait()
for i=200,120,-1 do
game.Workspace.Nuke.Missle:SetPrimaryPartCFrame(game.Workspace.Nuke.Missle:GetPrimaryPartCFrame()-Vector3.new(0,0.1*((1.1^(i/2.95))/4),0))
wait()
end
plr.PlayerGui.NukeWarning.Enabled = false
game.Workspace.Nuke.Missle.Tip.Transparency = 0.5
game.Workspace.Nuke.Missle.Tip.CanCollide = false
game.Workspace.Nuke.Missle.Tip.Mesh.Scale = Vector3.new(1,1,1)
local boom = game.Workspace.Nuke.Boom
boom.Parent = workspace
boom:Play()
local frame = game.Workspace.Nuke.Missle.Tip.CFrame
game.Workspace.Nuke.Missle.Tip.kill_script.Disabled = false
plr.PlayerGui.NukeWarning:Destroy()
for i=1,400 do
game.Workspace.Nuke.Missle.Tip.Size=game.Workspace.Nuke.Missle.Tip.Size+Vector3.new(3,3,3)
game.Workspace.Nuke.Missle.Tip.CFrame=frame
wait()
end
game.Workspace.Nuke.Missle.Tip.kill_script.Disabled=true
game.Workspace.Nuke.Missle:Destroy()
siren:Stop()
boom:Stop()
wait(5)
open:Play()
game.Workspace.Bunker.BunkerDoor.Door:Play()
game.Workspace["Warhead Control Facility"].NukeTrapdoor.Union.Transparency = 0
game.Workspace["Warhead Control Facility"].NukeTrapdoor.Union2.Transparency = 0
end
end
RemoteEvent.OnClientEvent:Connect(onClientReceive)
Thank you for your time!