Expected ')' (to close '(' at line 239), got 'end'

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!

i was rescripting my crap and theres an script error

  1. What is the issue? Include screenshots / videos if possible!

image

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

i tried and cant find for solutions

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

GUIinside.MouseButton1Click:connect(function()
	if Train.PSDAvailable.Value == false then
		if Train.DoorLeft.Value == true then

			L11:Play(0)
			L21:Play(0)
			L31:Play(0)
			L12:Play(0)
			L22:Play(0)
			L32:Play(0)
			L13:Play(0)
			L23:Play(0)
			L33:Play(0)
			L14:Play(0)
			L24:Play(0)
			L34:Play(0)
			front1body.Floor.DO:Play()
			wait(6)
			front1body.Floor.DCA:Play()
			wait(4)
			front1body.Floor.DC:Play()
		elseif Train.DoorLeft.Value == false then
			R11:Play(0)
			R21:Play(0)
			R31:Play(0)
			R12:Play(0)
			R22:Play(0)
			R32:Play(0)
			R13:Play(0)
			R23:Play(0)
			R33:Play(0)
			R14:Play(0)
			R24:Play(0)
			R34:Play(0)
			front1body.Floor.DO:Play()
			wait(6)
			front1body.Floor.DCA:Play()
			wait(4)
			front1body.Floor.DC:Play()
			wait(2)
			if Train.LastStop.Value == true then
				Train:Destroy()
			
			elseif Train.PSDAvailable.Value == true then
				front1seat.Touched:connect(function(child)
				child.Framework.DoorOpen.Value = true	
				
					if Train.DoorLeft.Value == true then

						L11:Play(0)
						L21:Play(0)
						L31:Play(0)
						L12:Play(0)
						L22:Play(0)
						L32:Play(0)
						L13:Play(0)
						L23:Play(0)
						L33:Play(0)
						L14:Play(0)
						L24:Play(0)
						L34:Play(0)
						front1body.Floor.DO:Play()
						wait(6)
						front1body.Floor.DCA:Play()
						wait(4)
						front1body.Floor.DC:Play()
					elseif Train.DoorLeft.Value == false then
						R11:Play(0)
						R21:Play(0)
						R31:Play(0)
						R12:Play(0)
						R22:Play(0)
						R32:Play(0)
						R13:Play(0)
						R23:Play(0)
						R33:Play(0)
						R14:Play(0)
						R24:Play(0)
						R34:Play(0)
						front1body.Floor.DO:Play()
						wait(6)
						front1body.Floor.DCA:Play()
						wait(4)
						front1body.Floor.DC:Play()
						wait(2)
						if Train.LastStop.Value == true then
							Train:Destroy()
						end
						child.Framework.DoorOpen.Value = false	
					end
				end
			end --Line 286
		end
	end
end

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

last line needs to be “end)”
never closed the “(“

1 Like

Add an extra parenthese at the error line. Also, loops would really make things easier.

1 Like

Since you have used
GUIinside.MouseButton1Click:connect(function() at the start, the last line needs to have end).

And you have also added an extra 'end'(There are only supposed to be 6 'ends')