Derma problem...

Hey, now I been trying to figure out this problem for HOURS! and i just wont work!!!
I searched all over the internet… No luck s:

Error:

autorun/client/cl_serverscript.lua:2: attempt to index global ‘vgui’ (a nil value)

code:

function testframe()
local frame1 = vgui.Create(“DFrame”)

    frame1:SetPos(100,100)
    frame1:SetSize(200,200)
    frame1:SetTitle("Test")
    frame1:MakePopup()

end
concommand.Add(“testframe”, testframe)

I get the problem like everyone else…
I putted it into: garrysmod/lua/autorun/client/fghgfh.lua
What am i doing wrong, and how do i fix it?

“cl_serverscript.lua” Are you sure you’re not calling it with the server -.-

What you mean?
I just gave it a name xD

You’re calling it with the server. That’s the only way it would give that error.

okay… so what should i do

[lua]
if CLIENT then
function testframe()
local frame1 = vgui.Create(“DFrame”)

frame1:SetPos(100,100)
frame1:SetSize(200,200)
frame1:SetTitle(“Test”)
frame1:MakePopup()
end
concommand.Add(“testframe”, testframe)
end[/lua]

Then call it with the client console. If it breaks, you don’t have the lua in the right place or something.

i figured it out. Now my only question is:
If i should check if a player is alive
if player:Alive()
How do i then use it in my “client sided” program?

…?

[lua]
if LocalPlayer():Alive() then
print(“I’m alive?”)
else
print(“Smelly foot?”)
end
[/lua]

Before learning lua learn English it will help a lot

Before judging one’s English, read up on punctuation. It will help a lot.

Just because i aint born in usa. Fuck head.
And i know my english. Why dont you learn to analyze a text?

[editline]06:49PM[/editline]

Ye, thanks.

“Just because I was not born in the USA**, fuck head.
And I know my English. Why don
’**t you learn to analyze text?”

You know, almost all of the people trying to help you were not born in the USA, yet they seem to have no problem with their grammar. Seriously, before flaming people, consider that you just tried to prove that you know English without actually proving it.

[editline]12:14PM[/editline]

A mistake is perfectly ok, but obviously not typing in correct English is a problem.

I aint not jugin u on ur english gbps. dont b hatin on uz foreners

I aint born in USA neitehr.

You didn’t get it…

fuck you i’m born iran i good english dik

lol (:

Heh.

[sp]
You know they’re making fun of you, right?[/sp]