This is probably extremely simple, and I’m looking for solutions.
This is my first attempt at lua, so please don’t be too harsh.
I’ve also probably made this really messy trying to fix the error.
local AnnounceButton = vgui.Create("DColorButton", SVFrame)
AnnounceButton:SetPos(5, 5)
AnnounceButton:SetSize(100, 60)
AnnounceButton:SetText("Announce")
AnnounceButton:SetColor(Color(255, 111, 0, 255))
AnnounceButton:SetContentAlignment(5)
AnnounceButton:SetTextColor(Color(255, 255, 255))
AnnounceButton.DoClick = function()
local AnnounceCheckBox = vgui.Create("DCheckBox")
AnnounceCheckBox:SetParent(DPanel)
AnnounceCheckBox:SetPos(25, 25)
AnnounceCheckBox:SetText("Announce changes to all players?")
AnnounceCheckBox:SetConVar("svcheater_announce")
AnnounceCheckBox:GetConVar("svcheater_announce")
svcheater_announce:GetInt = function(integer) -- function arguments expected near '=' NOTE: Originally I just used function() and instead of "if integer = 1 then" it was "if svcheater_announce = 1 then" but that delivered an error akin to "expecting function arguments"
if integer = 1 then
AnnounceCheckBox:SetValue(0)
else
AnnounceCheckBox:SetValue(1)
AnnounceCheckBox:DoClick() = function()
if integer then
svcheater_announce:SetInt(1)
else
svcheater_announce:SetInt(0)
end
end
end
end