Help needed with script

local terminalscreen = game:GetService("Workspace"):FindFirstChild("Terminal"):FindFirstChild("Terminal")
local debounce = false
local textbox = script.Parent
textbox:GetPropertyChangedSignal("Text"):Connect(function()


terminalscreen["Keyboard Typing 27 (SFX)"]:Play()
	print("work")

	task.wait(0.1)

	

	if textbox.Text == "rapture" or textbox.Text == "the quiet rapture" and not debounce == true  then
		debounce = true
		terminalscreen.SurfaceGui.TextBox.Text = "query) the quiet rapture"
		print("yes2")
		terminalscreen.SurfaceGui.Output.Text = [[in 357 eic, without any prior warning, radio contact with our respective planets was suddenly cut. nobody can recall having visual contact with any planets when the incident occurred, or experiencing any other unusual phenomena, so it's uncertain what exactly might have happened.]]
		task.wait(14)
		terminalscreen.SurfaceGui.Output.Text = [[upon investigation, it was observed independently by several stations that where there had previously been planets, nothing remained.]]
		task.wait(14)
		terminalscreen.SurfaceGui.Output.Text = [[further investigation over the following months revealed that all known planets with sentient life, floura and fauna, a habitable atmosphere, or any sort of natural resources were likewise gone.]]
		task.wait(14)
		terminalscreen.SurfaceGui.Output.Text = [[along with all known stars. the only celestial bodies that have been found since are either uninhabitable moons or asteroids.]]
		task.wait(14)
		terminalscreen.SurfaceGui.Output.Text = [[many theories have been proposed for this disaster, including religious interpretations of it as a literal rapture, some unknown quantum anomaly, or something more cosmic and sinister. there are no concrete answers yet. ]]
		task.wait()
	    debounce = false
		script.Parent.Parent.Parent:FindFirstChild("Terminal Gui").Enabled = false
	end
	if textbox.Text == "mars" and not debounce == true then

	end
	if textbox.Text == "iron lung" or textbox.Text == "sm13" and not debounce == true then

	end
	if textbox.Text == "interstellar martian calander" or textbox.Text == "imc" and not debounce == true then
	    debounce = true
		terminalscreen.SurfaceGui.TextBox.Text = "query) imc"
		terminalscreen.SurfaceGui.Output.Text = [[known commonly as imc, the interstellar martian calander is an alternative to the more widely used eic. it was poised to be officially adopted by mars before the quiet rapture.]]
		task.wait(15)
		terminalscreen.SurfaceGui.Output.Text = [[whereas eic is based on the rotation of earth, imc is based on the rotation of mars, meaning that one year in imc is about 1.88 years in imc. currently only eden, a former martian space station, uses imc.]]
		task.wait()
		debounce = false
		script.Parent.Parent.Parent:FindFirstChild("Terminal Gui").Enabled = false
	end
end)

debounce doesn’t work even though it should

Could you please explain what exactly isn’t working correctly? Are you receiving any errors from the output?

No errors at all, and I told you the debounce doesn’t work.

Try and see if this code works:

local terminalscreen = game:GetService("Workspace"):FindFirstChild("Terminal"):FindFirstChild("Terminal")
local debounce = false
local textbox = script.Parent

textbox:GetPropertyChangedSignal("Text"):Connect(function()


	terminalscreen["Keyboard Typing 27 (SFX)"]:Play()
	print("work")

	task.wait(0.1)


	if not debounce then
		
		if textbox.Text == "rapture" or textbox.Text == "the quiet rapture"  then
			debounce = true
			terminalscreen.SurfaceGui.TextBox.Text = "query) the quiet rapture"
			print("yes2")
			terminalscreen.SurfaceGui.Output.Text = [[in 357 eic, without any prior warning, radio contact with our respective planets was suddenly cut. nobody can recall having visual contact with any planets when the incident occurred, or experiencing any other unusual phenomena, so it's uncertain what exactly might have happened.]]
			task.wait(14)
			terminalscreen.SurfaceGui.Output.Text = [[upon investigation, it was observed independently by several stations that where there had previously been planets, nothing remained.]]
			task.wait(14)
			terminalscreen.SurfaceGui.Output.Text = [[further investigation over the following months revealed that all known planets with sentient life, floura and fauna, a habitable atmosphere, or any sort of natural resources were likewise gone.]]
			task.wait(14)
			terminalscreen.SurfaceGui.Output.Text = [[along with all known stars. the only celestial bodies that have been found since are either uninhabitable moons or asteroids.]]
			task.wait(14)
			terminalscreen.SurfaceGui.Output.Text = [[many theories have been proposed for this disaster, including religious interpretations of it as a literal rapture, some unknown quantum anomaly, or something more cosmic and sinister. there are no concrete answers yet. ]]
			task.wait()
			debounce = false
			script.Parent.Parent.Parent:FindFirstChild("Terminal Gui").Enabled = false
		
		
		elseif textbox.Text == "mars" then

		
		elseif textbox.Text == "iron lung" or textbox.Text == "sm13" then

		
		elseif textbox.Text == "interstellar martian calander" or textbox.Text == "imc" then
			debounce = true
			terminalscreen.SurfaceGui.TextBox.Text = "query) imc"
			terminalscreen.SurfaceGui.Output.Text = [[known commonly as imc, the interstellar martian calander is an alternative to the more widely used eic. it was poised to be officially adopted by mars before the quiet rapture.]]
			task.wait(15)
			terminalscreen.SurfaceGui.Output.Text = [[whereas eic is based on the rotation of earth, imc is based on the rotation of mars, meaning that one year in imc is about 1.88 years in imc. currently only eden, a former martian space station, uses imc.]]
			task.wait()
			debounce = false
			script.Parent.Parent.Parent:FindFirstChild("Terminal Gui").Enabled = false
		end
	end
end)

now I have another issue once the text gui is gone, when I use the keyboard it doesn’t come back

Is Terminal Gui the Text Gui you are talking about? If it is, it probably is because you are setting the Enabled property of the ScreenGui to false and not setting it back to true?

I dont have to set it back to true because the keyboard does, but it isn’t for some reason

That seems to be an issue with the script that handles the keyboard part. Could you possibly show the code of that script?

yes


detect.Triggered:Connect(function(plr)
	
	print(plr, plr.PlayerGui:FindFirstChild("Terminal Gui"))
	plr.PlayerGui:FindFirstChild("Terminal Gui").Enabled = true
	print(plr.PlayerGui:FindFirstChild("Terminal Gui").Enabled)

end)

There doesn’t seem to be any issue with this script. Is the code you have just send in a Local Script or a Server Script, and is the code with the debounce in a Local Script or a Server Script?
And also, is the output printing true or false when using the ProximityPrompt?

The code i sent is in a server script, the debounce is a local script, it prints true

I believe that could be the issue. Why not try using a Local Script for the ProximityPrompt code, and have the script parented in StarterPlayerScript, see if that could fix the issue.

2 Likes

ok I’ll try that right now------

IT WORKS thank you so much u are a live saver

1 Like

You are welcome, Happy to help!

wait I have one more issue i am so sorry for bothering

script.Parent.Parent:FindFirstChild("Terminal Gui").Enabled = false

this line of code doesn’t disable the gui

Oh, what is your issue ?

Character Limit

I fixed it nevermind thanks for the help

2 Likes