I want my system to post an error message if the user inputted into the textbox is invalid. How would I go about doing this using my existing code?
local IO = game:GetService("ReplicatedStorage"):WaitForChild("Events").InvokeOrder
script.Parent.Start.MouseButton1Click:Connect(function() -- Enter button next to text box.
local name = script.Parent.CustomerName.Text -- Text box user inputs text into.
for _,v in pairs(game.Players:GetPlayers()) do
if v.Name == name then
IO:Fire(name)
end
end
end)
local IO = game:GetService("ReplicatedStorage"):WaitForChild("Events"):WaitForChild("InvokeOrder")
local players = game:GetService("Players")
local localPlr = players.LocalPlayer
local localName = localPlr.Name
local start = script.Parent:WaitForChild("Start")
local customerName = script.Parent:WaitForChild("CustomerName")
start.MouseButton1Click:Connect(function()
local plrName = customerName.Text
if plrName == localName then
return --dont want to allow players to invoke an order to themselves
else
if players:FindFirstChild(plrName) then
IO:Fire(plrName)
end
end
end)