Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-2

Is it possible to..?

Asked by 10 years ago

I know you can use a local script in a screengui to make it so you hit a button and something happens, but is it possible to make it so something happens if you do something like this? a,a,b,b,c,c

2 answers

Log in to vote
-1
Answered by 10 years ago

in that case you want to set up a sort of "event" counter, that fires based off of what happens and what will happen.

local counter = 1
local sequence = {"a","b","q","c","d","g"}

for i,v in pairs(script.Parent:GetChildren()) do --idk if this is against the rules...
    if v:IsA("TextButton") then
        v.MouseButton1Down:connect(function()
            if v.Text:lower() == sequence[counter] then
                if counter < #sequence then
                    counter = counter + 1
                else
                    print("Sequence complete")
                end
            else
                counter = 1 -- they messed up, start over.
            end
        end)
    end
end--the ideal is possible, yes. You can create a secret passcode entrance or whatever.
--however, this script is a rough form of what i would deem a possible solution.

this goes off the assumption that the text of the buttons are the same as the sequence table. but the same logic goes, as long as you have the right idea.

0
Pressing the buttons in a sequence. zachhg03 35 — 10y
0
I was making the script in an easy fashion then read the second comment below, so i removed the majority of it. should i post it? TigerCaptain 75 — 10y
0
It doesn't matter. zachhg03 35 — 10y
Ad
Log in to vote
1
Answered by 10 years ago

This is NOT a request site.

0
I was asking a question on if it was possible. zachhg03 35 — 10y
0
That's still against the rules, this is a site to edit others' scripts. SchonATL 15 — 10y

Answer this question