So to start off with, yes I am fairly new to Lua and I’m trying to learn it by looking at existing scripts and modifying them and then merging ideas together. It’s what works for more more efficently.
Anyway, for my problem, I am trying to make it so that when the admin presses the button within the menu, they are prompted with a box that says ‘Write here…’ and then whatever they write in their gets displayed on all current players’ screens as the @@@ chat function does. However when I am using the code I have written, what happens is instead of the output being
I’ve tried modifying it as much as I can to my knowledge, so instead I’ve come to these forums. This is the code that is responsible for the output.
function makeAnnouncement() local dp = vgui.Create("DFrame") dp:SetSize(400,75) dp:Center() dp:SetTitle("Write your announcement") dp:MakePopup() local dte = vgui.Create("DTextEntry",dp) dte:SetSize(200,30) dte:SetPos(30,25) dte:CenterHorizontal() dte:SetValue("Write here...") dte.OnEnter = function(self) reason = self:GetValue() RunConsoleCommand("say"," @@@", reason) dp:Close() end end