how to?

Posts 115 of 24 · Page 1 of 2
how to?
how do i make so my wall hack gets disabled if im dead?

My current code(the part whit bald is probably wrong somehow)
Code:
LocalPlayer():ChatPrint("Names Loaded")
hook.Add( "HUDPaint", "Wallhack", function()
 
	for k,v in pairs ( player.GetAll() ) do
		if(LocalPlayer():Alive() = true) then 
		local Position = ( v:GetPos() + Vector( 0,0,80 ) ):ToScreen()
		draw.DrawText( v:Name(), "ChatFont", Position.x, Position.y, Color( 10, 255, 0, 255 ), 1 )
		else
 		LocalPlayer():ChatPrint("names off")
	end
 
end )
So you're checking if you're alive?
Quote Originally Posted by Gray View Post
So you're checking if you're alive?
exactly!(10char)

i got banned from my favourite server for 2 weeks for aimbotting and i didnt aimbot :C
Quote Originally Posted by makee View Post
exactly!(10char)
I'll give you a forum hint, message too short?
Just hold space a second or two and then a dot after your message.

If you run this ingame what happens?
it gives me an lua error and it wont show the names
EDIT: the error
[ERROR] lua/wh2.lua:5: ')' expected near '='
1. unknown - lua/wh2.lua:0
Quote Originally Posted by makee View Post
it gives me an lua error and it wont show the names
Post it .
i did post it
I meant the error haha.
What the console say when you load it.
it right there you blind....

it gives me an lua error and it wont show the names
EDIT: the error
[ERROR] lua/wh2.lua:5: ')' expected near '='
1. unknown - lua/wh2.lua:0
Try
if(LocalPlayer():Alive() == true) then

I'm not too good with this but I think one = is the same trying to tell the code to set it to.
and == is a comparison and I think that's what you need.
Quote Originally Posted by Gray View Post
Try
if(LocalPlayer():Alive() == true) then

I'm not too good with this but I think one = is the same trying to tell the code to set it to.
and == is a comparison and I think that's what you need.
well this shows up
[ERROR] lua/wh2.lua:13: unexpected symbol near ')'
1. unknown - lua/wh2.lua:0
Code:
LocalPlayer():ChatPrint("Names Loaded")
hook.Add( "HUDPaint", "Wallhack", function()
 
	for k,v in pairs (player.GetAll()) do
                        if v ~= LocalPlayer() then
		if(LocalPlayer():Alive() = true then 
		local Position = ( v:GetPos() + Vector( 0,0,80 ) ):ToScreen()
		draw.DrawText( v:Name(), "ChatFont", Position.x, Position.y, Color( 10, 255, 0, 255 ), 1 )
		else
                LocalPlayer():ChatPrint("names off")
	end)
end)
No Genius, but this might work, also if it doesn't you'll probably need to add a ConVar
Quote Originally Posted by Razer- View Post
Code:
LocalPlayer():ChatPrint("Names Loaded")
hook.Add( "HUDPaint", "Wallhack", function()
 
	for k,v in pairs (player.GetAll()) do
                        if v ~= LocalPlayer() then
		if(LocalPlayer():Alive() = true then 
		local Position = ( v:GetPos() + Vector( 0,0,80 ) ):ToScreen()
		draw.DrawText( v:Name(), "ChatFont", Position.x, Position.y, Color( 10, 255, 0, 255 ), 1 )
		else
                LocalPlayer():ChatPrint("names off")
	end)
end)
No Genius, but this might work, also if it doesn't you'll probably need to add a ConVar
yea... nope
[ERROR] lua/wh2.lua:6: ')' expected near '='
1. unknown - lua/wh2.lua:0
and it doenst work
Quote Originally Posted by makee View Post
yea... nope and it doenst work
Weird, I just looked at it in notepad++ nothing wrong, but just incase
Code:
LocalPlayer():ChatPrint("Names Loaded")
hook.Add( "HUDPaint", "Wallhack", function()
 
	for k,v in pairs (player.GetAll()) do
	if GetConVarNumber("Wallhack") >= 1 then
                        if v ~= LocalPlayer() then
		if(LocalPlayer():Alive() then
		local Position = ( v:GetPos() + Vector( 0,0,80 ) ):ToScreen()
		draw.DrawText( v:Name(), "ChatFont", Position.x, Position.y, Color( 10, 255, 0, 255 ), 1 )
		else
                LocalPlayer():ChatPrint("names off")
	end)
end)

CreateClientConVar("Wallhack", 0, true, false)
Quote Originally Posted by Razer- View Post
Weird, I just looked at it in notepad++ nothing wrong, but just incase
Code:
LocalPlayer():ChatPrint("Names Loaded")
hook.Add( "HUDPaint", "Wallhack", function()
 
	for k,v in pairs (player.GetAll()) do
	if GetConVarNumber("Wallhack") >= 1 then
                        if v ~= LocalPlayer() then
		if(LocalPlayer():Alive() then
		local Position = ( v:GetPos() + Vector( 0,0,80 ) ):ToScreen()
		draw.DrawText( v:Name(), "ChatFont", Position.x, Position.y, Color( 10, 255, 0, 255 ), 1 )
		else
                LocalPlayer():ChatPrint("names off")
	end)
end)

CreateClientConVar("Wallhack", 0, true, false)
k will try this now


edit: aaaand nope :C
[ERROR] lua/wh2.lua:6: 'then' expected near ')'
1. unknown - lua/wh2.lua:0
Posts 115 of 24 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?