Why is this not working?

I GOT IT!

I found the issue:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteEvent = ReplicatedStorage.NukeEvent -- // Change the name of this to the name of your remote event

local function onClientReceive()
	wait(1)

	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()

			coroutine.resume(coroutine.create(function()
				local lights = game.Workspace.Nuke.Lights:GetChildren()
				for i=1,100 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(2)

			game.Workspace.Nuke.Missle.Base.Fire.Enabled = true
			game.Workspace.Nuke.Missle.Base.Smoke.Enabled = true

			wait(3)

			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()
			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	

			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.Boom.Disabled = false	

			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.Boom.Disabled=true
			game.Workspace.Nuke.Missle:Destroy()
			siren:Stop()
			boom:Stop()


		end
	end) -- not ment to have a bracket at the end
end -- this isn't ment to be here

RemoteEvent.OnClientEvent:Connect(onClientReceive)

:heart: Thank you to all of you that have helped me! @Schedency @aabols2010 @ar_qx

I am marking the most helpful reply as the solution.

See you soon!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.