Very wierd derma error

Whenever I type in the assigned concommand to the code i’ll show you in a minute, I get this error:

autorun/webbrowser.lua:7: attempt to perform arithmetic on global ‘ScrH’ (a function value)

[lua]
if CLIENT then

function colzdragonWebBrowser( )

local frame = vgui.Create(“DFrame”)
frame:Center()
frame:SetSize(ScrW() - 100, ScrH() - 100)
frame:SetTitle(“Colzdragon Web Browser”)
frame:MakePopup()

webBrowser = vgui.Create(“HTML”)
webBrowser:SetParent( frame )
webBrowser:SetPos(50,50)
webBrowser:SetSize(ScrW() - 100, ScrH() - 100)
webBrowser:OpenURL(“http://www.colzdragon.com/browser/”)
end
concommand.Add( “colzdragonbrowser”, colzdragonWebBrowser )
end

if not SERVER then return end
AddCSLuaFile( “autorun/webBrowser.lua” )

function colzdragonWebBrowser( )

local frame = vgui.Create(“DFrame”)
frame:Center()
frame:SetSize(ScrW() - 100, ScrH() - 100)
frame:SetTitle(“Colzdragon Web Browser”)
frame:MakePopup()

webBrowser = vgui.Create(“HTML”)
webBrowser:SetParent( frame )
webBrowser:SetPos(50,50)
webBrowser:SetSize(ScrW() - 100, ScrH() - 100)
webBrowser:OpenURL(“http://www.colzdragon.com/browser/”)
end
concommand.Add( “colzdragonbrowser”, colzdragonWebBrowser )
[/lua]

What am I doing wrong?

DON’T define the derma serverside. It serves absolutely no purpose and is a complete failure as it wont do anything to make it work clientside and it could never work serverside anyway. Also in your case it is unnecessarily redundant. Also you should center the frame AFTER setting its size, usually its done after making it popup.

Also just a tip. Use tabs to format the code. You can see an example of how to do this in my code below. I used spaces in the below code to replace tabs though since tabs are overkill on FP

I don’t see the problem it is talking about, but lets set it to variables to be safe. Also you can set the parent directly in your vgui.Create statement
[lua]
if (CLIENT) then
function colzdragonWebBrowser( )
local w, h = ScrW(), ScrH()
local frame = vgui.Create(“DFrame”)
frame:SetSize(w - 100, h - 100)
frame:SetTitle(“Colzdragon Web Browser”)
frame:MakePopup()
frame:Center()

local webBrowser = vgui.Create("HTML", frame)
webBrowser:SetPos(50,50)   
webBrowser:SetSize(w - 100, h - 100)   
webBrowser:OpenURL("http://www.colzdragon.com/browser/")    

end
concommand.Add( “colzdragonbrowser”, colzdragonWebBrowser )
end
if (SERVER) then
AddCSLuaFile( “autorun/webBrowser.lua” )
end
[/lua]

Thank you so much!