Help my code? [NOOB]

Whenever I try to run my script on Garry’s Mod, I get this error:


ERROR] LuaCmd:1: bad argument #1 to 'RunString' (string expected, got no value)
  1. RunString - [C]:-1
   2. unknown - LuaCmd:1

Can anyone help me and tell me why? I suck at LUA, but I really need this to help admin my server…

Thanks!

Post your script here


local function ESP()
if( GetConVarNumber( 'esp_info' ) != 0 ) then
for k, v in pairs( player.GetAll() ) do
if( v:Alive() && v != LocalPlayer() ) then
local Pos = ( v:GetPos() + Vector( 0, 0, 75 ) ):ToScreen();
surface.SetDrawColor( team.GetColor( v:Team() ) )
draw.SimpleText( v:Name(), 'ESPFont', Pos.x, Pos.y, team.GetColor( v:Team() ), TEXT_ALIGN_CENTER );
draw.SimpleText( "HP: " .. v:Health(), 'ESPFont', Pos.x, Pos.y + 10, team.GetColor( v:Team() ), TEXT_ALIGN_CENTER );
draw.SimpleText("Project Cronus", "ESPFont", 50, 10, Color(0, 255, 0, 200)) // This had to go somewhere, Wasn't going to make a function just for it
draw.SimpleText("Version "..Version.."", "ESPFont", 140, 10, Color(255, 0, 0, 200))
end
end
end
end
hook.Add("HUDPaint","PlayerESP", ESP)
 
function WorldWireFrame()
if GetConVarNumber( "esp_worldwire" ) >=1 then
cvar2.SetValue("mat_wireframe","1")
else
cvar2.SetValue("mat_wireframe","0")
end
end
hook.Add("Think","WorldWireFramewtf",WorldWireFrame)
 
 
function BoundingBox()
if GetConVarNumber( "esp_box" ) >= 1 then
for k, v in pairs ( player.GetAll() ) do
if v ~= LocalPlayer() then
if v:Alive() and v:Team() ~= TEAM_SPECTATOR then
local PlayerBoxPos = v:EyePos():ToScreen()
surface.SetDrawColor( team.GetColor( v:Team() ) )
surface.DrawOutlinedRect( PlayerBoxPos.x - 40 / 3, PlayerBoxPos.y - 40 / 2, 30, 60 )
end
end
end
end
end
hook.Add( "HUDPaint", "CronusBoundingBox", BoundingBox )
 
// Chams
 
function PlayerModel()
if GetConVarNumber( "esp_chams" ) >= 1 then
for k, v in pairs(ents.GetAll()) do
if ValidEntity( v ) then
if v:IsPlayer() or v:IsNPC() then
v:SetMaterial( "models/wireframe" )
cam.Start3D( EyePos(), EyeAngles() )
v:DrawModel()
cam.End3D()
end
end
end
end
end
hook.Add( "HUDPaint", "Playermodel1", PlayerModel )
 
 
// Remove Skybox
function RemoveSky()
        if GetConVarNumber("misc_removesky") >= 1 then
        cvar2.SetValue( "gl_clear", "1")
        cvar2.SetValue( "r_drawskybox", "0")
        cvar2.SetValue( "r_3dsky", "0")
        else
        cvar2.SetValue( "gl_clear", "0")
        cvar2.SetValue( "r_drawskybox", "1")
        cvar2.SetValue( "r_3dsky", "1")
        end
end    
hook.Add( 'HUDPaint', 'Ilikemyskyblack', RemoveSky );
 
 
// Radar
function DoChecksRadar( e )
 
        local ply, val = LocalPlayer(), 0
       
        if ( e:IsPlayer() && e:GetMoveType() == MOVETYPE_OBSERVER ) then return false end
       
        if ( !e:IsValid() || !e:IsPlayer() && !e:IsNPC() || e == ply ) then return false end
        if ( e:IsPlayer() && !e:Alive() ) then return false end
        if ( e:IsNPC() && e:GetMoveType() == 0 ) then return false end
        if ( e:IsWeapon() && e:GetMoveType() == 0 ) then return false end
       
        return true
       
end
 
        local Radar = vgui.Create( "DFrame" )
        Radar:SetSize( 300, 300 )
       
        local rW, rH, x, y = Radar:GetWide(), Radar:GetTall(), ScrW() / 2, ScrH() / 2
       
        local sW, sH = ScrW(), ScrH()
        Radar:SetPos( sW - rW - 10, sH - rH - ( sH - rH ) + 10 )
        Radar:SetTitle("Cronus Radar")
        Radar:SetVisible( true )
        Radar:SetDraggable( true )
        Radar:ShowCloseButton( false )
        Radar:MakePopup()
        Radar.Paint = function()
                draw.RoundedBox( 0, 0, 0, rW, rH, Color( 0, 0, 0, 40 ) )
                surface.SetDrawColor( 255, 255, 255, 255 )
                surface.DrawOutlinedRect( 0, 0, rW, rH )
               
                local ply = LocalPlayer()
               
                local radar = {}
                radar.h         = 300
                radar.w         = 300
                radar.org       = 5000
               
                local x, y = ScrW() / 2, ScrH() / 2
               
                local half = rH / 2
                local xm = half
                local ym = half
               
                surface.DrawLine( xm, ym - 100, xm, ym + 100 )
                surface.DrawLine( xm - 100, ym, xm + 100, ym )
               
                for k, e in pairs( ents.GetAll() ) do
                        if ( DoChecksRadar(e) ) then
                               
                                local s = 6
                                local col = {}
                                local color = Color( 255,255,255,200 )
                                local plyfov = ply:GetFOV() / ( 70 / 1.13 )
                                local zpos, npos = ply:GetPos().z - ( e:GetPos().z ), ( ply:GetPos() - e:GetPos() )
                               
                                npos:Rotate( Angle( 180, ( ply:EyeAngles().y ) * -1, -180 ) )
                                local iY = npos.y * ( radar.h / ( ( radar.org * ( plyfov  * ( ScrW() / ScrH() ) ) ) + zpos * ( plyfov  * (ScrW() / ScrH() ) ) ) )
                                local iX = npos.x * ( radar.w / ( ( radar.org * ( plyfov  * ( ScrW() / ScrH() ) ) ) + zpos * ( plyfov  * (ScrW() / ScrH() ) ) ) )
                               
                               
                                local pX = ( radar.w / 2 )
                                local pY = ( radar.h / 2 )
                               
                                local posX = pX - iY - ( s / 2 )
                                local posY = pY - iX - ( s / 2 )
                               
                                local text = e:GetClass()
                               
                                if ( e:IsPlayer() ) then
                                        text = e:Nick() .. " ["..e:Health().."]"
                                end
                               
                                if iX < ( radar.h / 2 ) && iY < ( radar.w / 2 ) && iX > ( -radar.h / 2 ) && iY > ( -radar.w / 2 ) then
                               
                                        draw.RoundedBox( s, posX, posY, s, s, color )
 
                                end
                        end
                end
        end
       
        Radar:SetVisible( true )
        Radar:SetMouseInputEnabled( false )
        Radar:SetKeyboardInputEnabled( false )
        concommand.Add( "+mouseenable", function() Radar:SetMouseInputEnabled( true ) end )
        concommand.Add( "-mouseenable", function() Radar:SetMouseInputEnabled( false ) end )
       
        RRadar = Radar

I need to keep an eye on the people, but it doesn’t seem to be working.

Jesus where did you copy and paste this from?

…a website. >.>

I just need an ESP to help admin my server better, but clearly this doesn’t work.

We got the next Seth in here

If you need an ESP to administrate people, you’re a pretty bad admin. You can find any admin mod that has a spectate feature and use that instead.

I’ve tried that, it’s just hard to spectate every player in the server at one time.

Here’s a very very simple player marker.

[lua]

function PlayerMarker()

for k, v in pairs ( player.GetAll() ) do
 
	local Position = ( v:GetPos() + Vector( 0, 0, 65 ) ):ToScreen()
	
	if not ( v == LocalPlayer() ) then
	
		draw.RoundedBox( 0, Position.x - 8, Position.y - 8, 16, 16, team.GetColor( v:Team() ) )
		
	end
 
end

end
hook.Add( “HUDPaint”, “PlayerMarker”,PlayerMarker )
[/lua]

I have not tested this in-game, but everything should work fine.

Tested with bots before I tried it in my server, doesn’t seem to work.

hook.Add( “HUDPaint”, “Forgot this”, PlayerMarker )

Haha, thanks Shadow, I completely forgot about it. :slight_smile: