Why is this underlined red?

So in my code (in the picture below), there is a red underline underneath one of my “waits.”
Why is that?

There’s nothing wrong with my code, as it worked before… so why is there an error with my code all of the sudden?

I tried ending an “end” at the end, but then that
gets underlined (even though I know that wouldn’t really work.)

  1. Copy and paste your script and format it correctly. It’s annoying to read a small screenshot.
  2. You forgot to add another ) at the end (or just delete the one before that)
1 Like

You have an arbitrary opening parenthesis with no complementary closing parenthesis at line ~13, just remove it

image

1 Like

Okay, I realized the “)” part right when I made the post. But now there’s two red lines underneath both waits.

local textLabel = script.Parent:WaitForChild("Main"):WaitForChild("Text")
script.Parent.TextLabel.TextTransparency = 0
script.Parent.ImageLabel.ImageTransparency = 0
wait()

local function typewrite(object,text)
	
	for i = 1,#text,1 do
		object.Text = string.sub(text,1,i)
		wait(0.05)
	end
end

typewrite(textLabel,("Alright agent. I see that you have arrived. So first, you must get into the factory.")
wait(2)
typewrite(textLabel,("Something tells me that the front door won't work. Find another way to get in.")
wait(2)
	
	
	
script.Parent.Enabled = false
script.Parent.Main.Text.BackgroundTransparency = 1
	game.Workspace.Door5:Destroy()

Should be

typewrite(textLabel,"Alright agent. I see that you have arrived. So first, you must get into the factory.")
wait(2)
typewrite(textLabel,"Something tells me that the front door won’t work. Find another way to get in.")
wait(2)
2 Likes

You added another arbitrary opening parenthesis, just remove it again.

- typewrite(textLabel,("Alright agent. I see that you have arrived. So first, you must get into the factory.")
+ typewrite(textLabel, "Alright agent. I see that you have arrived. So first, you must get into the factory.")
wait(2)
- typewrite(textLabel,("Something tells me that the front door won’t work. Find another way to get in.")
+ typewrite(textLabel, "Something tells me that the front door won’t work. Find another way to get in.")
wait(2)
2 Likes