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

How to fix?

Asked by 8 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

I been trying to make a passchar out of a TextBox, but I can not get to work.

if script.Parent.Text == "A" or "B" or "C" or "D" or "E" or "F" or "G" or "H" or "I" or "J" or "K" or "L" or "M" or "N" or "O" or "P" or "Q" or "R" or "S" or "T" or "U" or "V" or "W" or "X" or "Y" or "Z"or "a" or "b" or "c" or "d" or "e" or "f" or "g" or "h" or "i" or "j" or "k" or "l" or "m" or "n" or "o" or "p" or "q" or "r" or "s" or "t" or "u" or "v" or "w" or "x" or "y" or "z" then
script.Parent.Text = "*"
0
Er, what you are doing is asking if it is EXACTLY A or B or exectra. I would love to answer right now, but it won't let me because I answered a question recently lightpower26 399 — 8y

1 answer

Log in to vote
1
Answered by
davness 376 Moderation Voter
8 years ago

if script.Parent.Text == "A" or "B" or "C" or "D" or "E" or "F" or "G" or "H" or "I" or "J" or "K" or "L" or "M" or "N" or "O" or "P" or "Q" or "R" or "S" or "T" or "U" or "V" or "W" or "X" or "Y" or "Z"or "a" or "b" or "c" or "d" or "e" or "f" or "g" or "h" or "i" or "j" or "k" or "l" or "m" or "n" or "o" or "p" or "q" or "r" or "s" or "t" or "u" or "v" or "w" or "x" or "y" or "z" then

First of everything, with that statement, you will get an enormus headache...

It is wrong, an correct statemnt would kill you...

if script.Parent,Text == "A" or script.Parent.Text == "B" or script.Parent.Text = "C"

-- This is an correct if statement, which kills you.

But we can solve this with a table:

local t = {"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"}

for i,v in pairs (t) do
    if script.Parent.Text == v then
    script.Parent.Text ="*"
end
0
or an `array` woodengop 1134 — 8y
Ad

Answer this question