Hello, DevFourm community! Today I am trying to make a system where the player can enter a name, description, and a Roblox group ID. Currently, I am writing a script so when the player clicks confirm it will check for blanks in the text boxes. If there are blanks I just want the console to print “Oh no there are blanks”
here is what I have so far:
local DescInput = script.Parent.Frame.DescInput
local ServerNameInput = script.Parent.Frame.ServerNameInput
local Confirm = script.Parent.Frame.Confirm
Confirm.MouseButton1Click:Connect(function()
if DescInput.Text and ServerNameInput.Text == " " then
print("Oh no! there are blanks!")
end
end
local DescInput = script.Parent.Frame.DescInput
local ServerNameInput = script.Parent.Frame.ServerNameInput
local Confirm = script.Parent.Frame.Confirm
Confirm.MouseButton1Click:Connect(function()
if DescInput.Text:match("%s") and ServerNameInput.Text:match("%s") or then
print("Oh no! there are blanks!")
end
end)
This should work, if not, reply or message me for help.
local DescInput = script.Parent.Frame.DescInput
local ServerNameInput = script.Parent.Frame.ServerNameInput
local Confirm = script.Parent.Frame.Confirm
Confirm.MouseButton1Click:Connect(function()
if DescInput.Text:find("%s") and ServerNameInput.Text:find("%s") then
print("Oh no! there are blanks!")
end
end)
With examples of string.find usage:
if string.find(DescInput.Text, "%s") and string.find(ServerNameInput.Text, "%s") then