Is there an easier way to write this, without writing many times if I add more? The models are from replicated storage
textBox:GetPropertyChangedSignal("Text"):Connect(function()
if textBox.Text == "DropperOne" then
placementModule:new("Dropper1", game.ReplicatedStorage.Models, plot.Plot, plot.PlacedObjects, false, true)
textBox.Text = ""
textBox.FocusLost = true
elseif textBox.Text == "DropperTwo" then
placementModule:new("Dropper2", game.ReplicatedStorage.Models, plot.Plot, plot.PlacedObjects, false, true)
textBox.Text = ""
textBox.FocusLost = true
elseif textBox.Text == "DropperThree" then
placementModule:new("Dropper3", game.ReplicatedStorage.Models, plot.Plot, plot.PlacedObjects, false, true)
textBox.Text = ""
textBox.FocusLost = true
elseif textBox.Text == "Conveyor" then
placementModule:new("Conveyor", game.ReplicatedStorage.Models, plot.Plot, plot.PlacedObjects, false, true)
textBox.Text = ""
textBox.FocusLost = true
end
end)
Thanks for the Help!

1 comment
Another question: is there a way to have the texbox lose its focus automatically?