EDIT: Completely new to Facepunch posting… I need this thread moved to the Modding category :S Sorry!!
Hi guys and girls.
I’ve been having issues with some code that was released by a community member of Facepunch; Bandit Kitteh, it was originally designed for a website URL but I’ve ‘attempted’ to get it working for HTML.
The code is below;
if CLIENT then concommand.Add("Motd",function(pl,cmd,args) local Frame = vgui.Create("DFrame") Frame:SetSize(ScrW() - 20, ScrH() - 20) Frame:Center() Frame:SetTitle("Sasso's District Server Rules") Frame:MakePopup() Frame:SetMouseInputEnabled(true) local html = vgui.Create("DHTML", Frame) html:SetPos(5,25) html:SetSize(ScrW() - 30, ScrH() - 30) html:SetHTML( file.Read( "data/sassomotd.txt" ) ) end) end if SERVER then hook.Add("PlayerSay", "ChatHook", function(Player, Text, Public) if Text == "!" then Text = Text:lower() if Text == "!motd" then Player:ConCommand("Motd") return "" end end end) end hook.Add("PlayerInitialSpawn", "OpenMotd", function(ply) ply:ConCommand("Motd") end)
The error I get from my servers console is this;
[ERROR] lua/autorun/motd.lua:13: bad argument #1 to 'SetHTML' (string expected, got no value) 1. SetHTML - [C]:-1 2. unknown - lua/autorun/motd.lua:13 3. unknown - lua/includes/modules/concommand.lua:69
I have no knowledge of LUA coding but attempted to adapt and learn… Failed miserably! What do I need to do to get this working?
Side note: I’m after an independent MOTD, one that is not apart of an admin mod such as ULX. Hence why I am attempting to get this working.