Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why does this Textbox script not work properly?

local input = script.Parent.Input
local output = script.Parent.Output

if input.Text:lower() == "a" then
	output.Text = "v"
end

I am trying to type a in a textbox called Input and another textbox called Output to say another letter ( V )

2 answers

The script is only going to check once. You need to set up an event which will trigger whenever the player has something typed in the input. Try this:

local input = script.Parent.Input
local output = script.Parent.Output

input.FocusLost:Connect(function()
	if input.Text:lower() == "a" then
	    output.Text = "v"
	end
end)

Use string.lower

local input = script.Parent:WaitForChild("Input")
local output = script.Parent:WaitForChild("Output")

function Changed()
if string.lower(input.Text) == "a" then 
output.Text = "v" 
end
end

input.Changed:Connect(Changed)

2 comments

0

he is tho...

0

ok, i changed other stuff

This discussion is preserved as it was. New answers, comments, and votes are closed.