I’ve tried multiple ways to try and fix this, but none of them work. I’ve tried msg.Text ~= “” yet it still doesn’t work.
uis.InputBegan:Connect(function(key, gpe)
if key.KeyCode == Enum.KeyCode.Return then
local msg = pui.RadioUI.Main.ChatFrame.TextBox
if #msg.Text > 0 then
if radioon == true then
print(tostring(radioon))
rs.Events.RadioMessage:FireServer(msg.Text, "broadcast")
pui.RadioUI.Main.ChatFrame.TextBox:ReleaseFocus()
pui.RadioUI.Main.ChatFrame.TextBox.Text = ""
else
print(tostring(radioon))
rs.Events.RadioMessage:FireServer(msg.Text, "proximity")
pui.RadioUI.Main.ChatFrame.TextBox:ReleaseFocus()
pui.RadioUI.Main.ChatFrame.TextBox.Text = ""
end
else
error("message cannot be empty")
end
end
end)
uis.InputBegan:Connect(function(key, gpe)
if key.KeyCode == Enum.KeyCode.Return then
local msg = pui.RadioUI.Main.ChatFrame.TextBox
if string.gsub(msg, "[ ]+", "") ~= "" then
-- removes tabs and spaces
if radioon == true then
print(tostring(radioon))
rs.Events.RadioMessage:FireServer(msg.Text, "broadcast")
pui.RadioUI.Main.ChatFrame.TextBox:ReleaseFocus()
pui.RadioUI.Main.ChatFrame.TextBox.Text = ""
else
print(tostring(radioon))
rs.Events.RadioMessage:FireServer(msg.Text, "proximity")
pui.RadioUI.Main.ChatFrame.TextBox:ReleaseFocus()
pui.RadioUI.Main.ChatFrame.TextBox.Text = ""
end
else
error("message cannot be empty")
end
end
end)