Need some commands named

Well, I’m pretty new to lua coding, and I need some help. Here’s the code I’m working on:
(Yes, it’s a aimbot. Big deal).

1). How would I replace the “player.GetByID(1)” so it’s me all the time, not just when I’m the first player. I’ve tried LocalPlayer instead of the ply(LocalPlayer:GetShootPos etc.)
2). How would I get the vector X and Y of the BoneIndx? I’ve tried GetBonePosition(BoneIndx.x), GetBonePosition(BoneIndx).x, etc. Right now it just points me to the origin of the map.

Oh yeah, I just copied the util.QuickTrace line from the wiki. I have no idea how it works.

1). LocalPlayer() not LocalPlayer

local pos, ang = traceRes.Entity:GetBonePosition(BoneIndx)
local cursorPos = pos:ToScreen()
local cursorX = cursorPos.x
local cursorY = cursorPos.y

Could I point something out?

[release]concommand.Add(“RunAimboat”, AimBotTest) print(“ConCommand Added”)[/release]

RunAimboat should be RunAimbot.

You can try this instead:

[lua]local function AimBotTest()
print(“AimBotTest Defined”)
local ply = LocalPlayer() – Always returns you if running on the client
local ent = LocalPlayer():GetEyeTrace().Entity – Gets the entity of where you’re looking, no need for a util.TraceRes
if ent:IsPlayer() or ent:IsNPC() then
– Instead of using SetCursorPos, you should use SetEyeAngles
local pos = ent:GetBonePosition(ent:LookupBone(“ValveBiped.Bip01_Head1”)) – Gets the position of the bone
LocalPlayer():SetEyeAngles( (pos - LocalPlayer():GetShootPos()):Angle() )
– Don’t ask me about the math, I’m bad at angles
concommand.Add(“RunAimbot”, AimBotTest)
print(“ConCommand Added”)[/lua]

MakeR: What’s the ang in there for? EDIT: Oh, just figured it out. But why do you need to define it if you’re not goign to use it?
Jamie932: It’s intended. Not a typo.
Entoros: I would use SetEyeAngles, but I’ve heard that most servers do an auto-ban if you run that command client-side.

To bypass custom anticheats, right?

You don’t have to define it, I just put it in there to make it clear that the function returns two objects.

fordlover98: Well, that, and the fact that my name is Portalboat. Aimboat. SEE THE CONTECTION :stuck_out_tongue:


I thought it was aimboat because aimbot would get you banned.

Thats probably the main reason why.

Well, it works. But:
1). It’s really spazzy.
2). If I strafe too fast, it “disconnects” from the target.

I’ll get a video up ASAP.