ESP Help.

How would i make it apply for a client then it is located serverside?


timer.Simple(15, function() ESP code end)

Would it work? And no i dont want to cheat on my server i just want to make a Score Streak system and this is 1 of currently 4 streaks.

The code you provided won’t do anything if ran serverside. ( You are not even targeting a player )

The correct way to do that is to use a NWBool or DataTable value to store if player should have it enabled or not.

So, in your CLIENTSIDE ESP code you do this before drawing the ESP in your drawing hook:

if ( !LocalPlayer():GetNWBool(“esp”, false ) ) then return end

And then you enable or disable the ESP for a player using this code SERVERSIDE:

ply:GetNWBool(“esp”, true )
where ply is the player object and true/false is enabled/disabled.

SetNWBool*

Thanks. Now i need a base to work with Box ESP. Anything good to start with?

[editline]8th October 2013[/editline]

I know it is client thing i fix that later but it is just a code i found.


--[[ 
Name: s0beit.lua 
Product: Client-side LUA hook 
Author: s0beit 
]]-- 

--Start of config 
local s0beitEspCvar = CreateClientConVar( "s0beit_esp", 1, true, false )  
--End of config 

local function HeadPos(ply) 
    if ValidEntity(ply) then 
        local hbone = ply:LookupBone("ValveBiped.Bip01_Head1") 
        return ply:GetBonePosition(hbone) 
    else return end 
end 

local function Visible(ply) 
    local trace = {start = LocalPlayer():GetShootPos(),endpos = HeadPos(ply),filter = {LocalPlayer(), ply}} 
    local tr = util.TraceLine(trace) 
    if tr.Fraction == 1 then 
        return true 
    else 
        return false 
    end     
end 

local function IsSteamFriend( ply ) 
    return ply:GetFriendStatus() == "friend" 
end 

local function FillRGBA(x,y,w,h,col) 
    surface.SetDrawColor( col.r, col.g, col.b, col.a ); 
    surface.DrawRect( x, y, w, h ); 
end 

local function OutlineRGBA(x,y,w,h,col) 
    surface.SetDrawColor( col.r, col.g, col.b, col.a ); 
    surface.DrawOutlinedRect( x, y, w, h ); 
end 

hook.Add( "HUDPaint", "DrawESP", DrawESP )

Just found this. I removed a crosshair code in it. Anyway this is from 2009. I need to convert it then i have time. Or is it easier to start from sratch?

Most of the time it’s easier to start from scratch than read through someone else’s code.

I try to use a wallhack tutorial for Gmod 12.

Idk if this would work


hook.Add( "HUDPaint", "ESP_Serverside", function()
 for k, v in pairs ( LocalPlayer() ) do
            local pos = ( v:GetPos() Vector( 0, 0, 80 )
			draw.RoundedBox( 4, 23, pos.x, pos.y, 231, 5, Color( 0, 0, 0, 255 ) )
end 
end

This is client side what ever but it give me a idea how it works. Im going to test it now

It will not work, replace “local pos …” with “local pos = v:GetPos():ToScreen()”

This is my new


hook.Add( "HUDPaint", "ESP_Serverside", function()
 for k, v in pairs ( player.GetAll() ) do
local pos =  (v:GetPos() + Vector(0, 0, 80)):ToScreen()
			draw.RoundedBox( 4, 23, pos.x, pos.y, 231, 5, Color( 0, 0, 0, 255 ) )
end 
end

It doesnt want to work…

Judging by the name of your hook you are executing the code server side, which will obviously not work. Read my earlier post.

This is client side though. I want to know how to make it client side then i try to make it server side

Also, the “23” seems like an extra, unneeded argument, remove it.

Also, if the script creates errors, you should post the error too.

It doesnt load ;( placed in lua/autorun/client

And that’s the only content of the file and there are no Lua errors in console?

Only lua errors is from my gamemode so nooe no lua errors

[editline]8th October 2013[/editline]

Got it working <3. I post screenshot in soon

[editline]8th October 2013[/editline]

It is supposed to work like this :

http://cloud-2.steampowered.com/ugc/595890678294205600/B34500ED7401028C69C8A6B454C7C389D9FF02D9/

The box go at side too i want it to be a box in all angles like you know CSS hacks do
Can anyone help me
Examples:
http://cloud-2.steampowered.com/ugc/595890678294202360/A129E17FC79401F113C6CD48CD0250B898D0B813/
http://cloud-2.steampowered.com/ugc/595890678294198067/3F916158B0768D9DB9F9A6F2775643B4B5175DB9/

Code:


hook.Add( "HUDPaint", "ESP_Serverside", function()
 for k, v in pairs ( player.GetAll() ) do
local pos =  (v:GetPos() + Vector(20, 10, 70)):ToScreen()
local pos2 =  (v:GetPos() + Vector(20, -20, 70)):ToScreen()
local pos3 =  (v:GetPos() + Vector(20, 0, 70)):ToScreen()
local pos4 =  (v:GetPos() + Vector(20, 10, 70)):ToScreen()
			draw.RoundedBox( -3, pos.x, pos.y, 2, 230, Color( 120, 255, 200, 255 ) )
			draw.RoundedBox( -3, pos2.x, pos2.y, 2, 230, Color( 120, 255, 200, 255 ) )
			draw.RoundedBox( 20, pos3.x, pos3.y, 2, 1, Color( 120, 255, 200, 255 ) )
			draw.RoundedBox( -3, pos4.x, pos4.y, 2, 230, Color( 120, 255, 200, 255 ) )
			
end
end)

If you can’t add the top and bottom lines I’m doubting you understand what you’re doing at all. The code tabulation supports that theory too.

I’m not going to give you code to copy and paste into your gamemode. Also that ESP is the most ugly thing I have ever seen.

If you’re actually trying to learn I suggest reading up on vector mathematics.

WorldSpaceAABB

I can easy add top and bottom. I just want to know How to make it follow like CSS