Today I am trying to make a system where the player can enter a name, description, and a Roblox group ID

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

image

Missing something. Good luck with your learning though!
:slight_smile:

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.

1 Like

You can also :find()!

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
1 Like

Are there any benefits to using :find?

Also “%s” is for spaces. (extra info I forgot to write about in the solution post.)

Any clue on how I would go about making a censoring system so that if there is a bad word in it it wont allow them to hit confirm?

Here: Text Filtering | Roblox Creator Documentation

1 Like

Thank you so much for all of your help!

1 Like