Dialogue script not working


I made this dialogue script the player talk to a npc through GUI then the player pick his/her choices. I found this topic where it detects if player click button twice or more
here is the topic How to check if a player clicked with their mouse twice? - #12 by NucleiEye .

I did what exactly said in the solution script but from some reason the NPC repeats it’s line twice. I made a simple script to test out if the script works( the topic I found ) it worked perfectly.

also here is my script:

if clicks == 1 then
		bg2.Visible = false

		TypeWriter.typeWrite(DialougeText, "I'm doing good " .. player.Name .. " , How about you?")
		bg2.Visible = true
		A1.Text = "Im also doing good too!"
	if clicks >= 2 then
		bg2.Visible = false
		TypeWriter.typeWrite(DialougeText, "Oh really?")
		TypeWriter.typeWrite(DialougeText, "Anyway, It's been along time since we last met ey?")
		TypeWriter.typeWrite(DialougeText, "and also wanna meet up in my place?")
		bg2.Visible = true
		A1.Text = "Sure!"
	if clicks >= 3 then
		bg2.Visible = false
		NameText.Text = player.Name .. " Mind"
		TypeWriter.typeWrite(DialougeText, "Then I went to his place and play video games")
		TypeWriter.typeWrite(DialougeText, "After that it was really dark so I went home")
		TypeWriter.typeWrite(DialougeText, "We were having fun we talk about our past and have some fun")
		TypeWriter.typeWrite(DialougeText, "I hope we can meet up again")
		TypeWriter.typeWrite(DialougeText, "Thanks Noob for being my friend when I first join Roblox...")
		player:Kick("You got the good ending B) --Creator")

A1 means the first choice
bg2 - there are 2 choices for the player to pick it consist the A1 and the A2 bg2 is the background of the both

The problem : the dialogue 2 ( the one who has if click >=2 then )
repeats twice when it’s the third click.

I added prints to check it out Test 2 repeats

You can remove >= and replace it with == in this case if you don’t want it to repeat dialogue 2 twice

which line of the script???‎‎‎‎‎‎‎‎

Your if click >= 2 then line, since it’s going to run even if click is 3 or higher, change >= to ==

wow i didn’t know it was this simple also thx for the help!

1 Like

Anytime! If you have anymore issues don’t be afraid to make another post!