How to make an Order Click Puzzle?

How would I make a puzzle that would run a script if you click 3 parts in a certain order? i’m not sure how I would do this.

if theres 3 parts its kinda fast to find the answer, also would u like some kind of resetting system if someone has clicked something

its not for anything super important, just for an easter egg, also if they clicked the wrong one it would reset

first make this:
image

then to script copy:

local part1 = script.Parent.Part1
local part2 = script.Parent.Part2
local part3 = script.Parent.Part3

local currentpoint = 1

local code1 = part2 -- first click
local code2 = part1 -- second click
local code3 = part3 -- third click

function clicked(part)
	print(part)
	if currentpoint == 1 then
		if part == code1 then
			currentpoint = currentpoint + 1
		end
	elseif currentpoint == 2 then
		if part == code2 then
			currentpoint = currentpoint + 1
		else
			currentpoint = 1
		end
	elseif currentpoint == 3 then
		if part == code3 then
			currentpoint = 1
			script.Parent.Event:Fire()
		else
			currentpoint = 1
		end
	end
end

part1.ClickDetector.MouseClick:Connect(function()
	clicked(part1)
end)
part2.ClickDetector.MouseClick:Connect(function()
	clicked(part2)
end)
part3.ClickDetector.MouseClick:Connect(function()
	clicked(part3)
end)

and to the activatorscript put:

script.Parent.Event.Event:Connect(function()
	print("Activated")
end)

2 Likes

putting it together now, will let you know how it goes

1 Like

worked like a charm, thank you so much!

1 Like