New here, I have been encountering issues that I can not solve. Could anyone help me fix this problem?
local ziks = 1
local zikskill = 0
local sid = "NULL"
concommand.Add( "sid", function( ply, cmd, args )
local args2 = table.concat( args)
if args2 then
sid = args2
print(sid)
end
ziks = player.GetBySteamID(sid)
zikskillstart = ziks:Frags()
end)
local ztab = { ziks }
local function OriginCam()
ziks:SetNoDraw(true)
ziks:SetPredictable(false)
local zorigin = ziks:EyePos()
local CamData = {}
CamData.angles = ziks:EyeAngles()
CamData.origin = zorigin
CamData.x = 0
CamData.y = 0
CamData.w = ScrW() / 2
CamData.h = ScrH() / 2
CamData.drawviewmodel = false
render.RenderView( CamData )
end
hook.Add("HUDPaint", "OriginCam", OriginCam)
local function crosshair()
surface.SetDrawColor( 0, 255, 0, 255 )
surface.DrawRect( (ScrW()/4)-2, (ScrH()/4)-2, 4, 4 )
end
hook.Add("DrawOverlay","cross",crosshair)
ply = LocalPlayer()
hook.Add('HUDPaint','Tracer', function()
for i,v in pairs(player.GetAll()) do
if v:SteamID() == sid then
surface.SetDrawColor( 255, 100, 100, 255 )
pstart = v:GetBonePosition( v:LookupBone('ValveBiped.Bip01_Head1') ):ToScreen()
pend = util.TraceLine(util.GetPlayerTrace(v)).HitPos:ToScreen()
surface.DrawLine(pstart.x,pstart.y,pend.x,pend.y)
end
end
end)
I keep getting this error.
[ERROR] lua/render.lua:19: attempt to index upvalue 'ziks' (a number value)
1. v - lua/render.lua:19
2. unknown - lua/includes/modules/hook.lua:84
Code still doesn't work, getting a different error.
Have you toyed with the idea of posting the error?
We need some errors to know whats wrong. I guess it would be the same error as before that ziks is a number value... just use
something like
player.GetAll() and write the players in a table and choose one for the ziks value.. or something like this..
Sorry, you need to Log In to post a reply to this thread.