Problems with my nuke

Hey, I’m working on a game, and I’m struggling with a nuke that I’m making. I’ve been scripting for a while, but I just cant get the hang of it. There’s this bug that I can’t figure out that after you say “No”, if you say “Yes” it will continue to ignore all of the false variables I put in to stop that. Can somebody help me? Here’s my code:

can you reply to this post quoting the part of the script that you are talking about, i cant seem to find it.

				NukeScreen.Text = "Authorized. Would you like to activate the nuclear dettonation procedure? Say: Yes or No to choose."
					Player.Chatted:Connect(function(Message)
					MessageLock = false
						if Message == "Yes" then
							if MessageLock == false then
								MessageLock = true
						wait(1)
						NukeScreen.Text = " Nuclear Detonation Procedure Commencing..."
		wait(5)
		Open1:Play()
		Open2:Play()
		wait(3)
		Rise:Play()
		wait(5)
		wait(3)
		Platform.Anchored = true
		Platform.WeldConstraint:Destroy()
		NukeScreen.Text = "10"
		wait(1)
		NukeScreen.Text = "9"
		wait(1)
		NukeScreen.Text = "8"
		wait(1)
		NukeScreen.Text = "7"
		wait(1)
		NukeScreen.Text = "6"
		wait(1)
		NukeScreen.Text = "5"
		wait(1)
						NukeScreen.Text = "4"
						game.ReplicatedStorage.Particles.Parent = Nuke
		wait(1)
		NukeScreen.Text = "3"
		wait(1)
		NukeScreen.Text = "2"
		wait(1)
						NukeScreen.Text = "1"
						wait(1)
		NukeScreen.Text = "0"
		wait(1)
		NukeScreen.Text = ""
		Launch:Play()
		game.ReplicatedStorage.Warning:FireAllClients()
		wait(3)
		Nuke.Orientation = Vector3.new(-90, 0, 0)
		wait(3)
		Close1:Play()
		Close2:Play()
		wait(1)
						Drop:Play()
						game.Workspace.OpenParts.Nuke.Particles.Parent = game.ReplicatedStorage

		wait(0.5)
		Nuke:Destroy()
		wait()
		Explosion.Parent = game.Workspace
								
		for count = 1, 100 do
			wait(0.1)
			Explosion.Size = Explosion.Size + Vector3.new(20)
			for i, touched in pairs(Explosion:GetTouchingParts()) do
									touched.Material = Enum.Material.CorrodedMetal
									
								end
				
							end
						else
							return
		end
		game.ReplicatedStorage.Sky.Parent = game.Lighting
		Explosion.Size = Vector3.new(1)
		Explosion.Parent = game.ReplicatedStorage
		wait(7)
						NukeScreen.Text = "Nuclear Dettonation Complete, Remaining Shells: 0/1."
						elseif Message == "No" then
							if MessageLock == false then
								MessageLock = true
						wait(1)
						Enabled = false
							NukeScreen.Text = "Insert Nuclear Clearance Card."
						else 
							
							return end
						
							
					end
				end)
				end)
			
		end
	end
end

end)

So after the player clicks the “no” button, the “yes” button no longer works?

No, the player SAYS no. or Yes. It happens vice versa. That’s why i sent the code, idk what i did wrong.

Also, its the complete opposite, if i say no, then yes, the meaning of “No” was to stop it from working and to reset it. However, if you say “Yes” after it, it still goes through with it. That’s the problem

Then the problem must be that you didn’t reset everything to the way it was before you pressed the button.
What is MessageLock btw?

its used to stop it from happening but it doesnt work, heres a video, itll help you understand
robloxapp-20220717-1022043.wmv (2.6 MB)

how do you do that though lmfao

First and foremost. Your using CFrame wrong.


local NukeRise = {CFrame = Nuke.CFrame * CFrame.new(0,0,40)}
local NukeLaunch = {CFrame = Nuke.CFrame * CFrame.new(0,0,800)}
local NukeDrop = {CFrame = Nuke.CFrame * CFrame.new(0,0,-840)}

that. is. not. the. problem. ok?

oh. ok. thought. it. was. the. problem. cuz. the. post. gave. me. a. stroke. cuz. how. compact. it. was.

ok so

look at the video i sent a couple posts above, it will show you what the problem is

Ok amogus person the problem is that when you say No the script does NOT stop. Which u know now what you can do. Is make a variable thats called doNuke If its true than “Yes” would work. And when you insert ur keycard its set to true and yea if u say “No” its set to false. Get it? I am not gonna do it cuz how messy that script is.