So im having trouble in running this function ( im really new to coding in lua, ive read and finished Java only)
Where do i put this? In gamemode? An Addon? or run it straight in console? is there and addon i can use run this type of code in?
Appreciate any help i cant get, even tho i know its a dumb question ive been trying to get it work and i cant figure it out.
This is the function they want to put in. GM:CalcView( Player ply, Vector origin, Angle angles, number fov, number znear, number zfar )
This is what the page shows
local function MyCalcView( ply, pos, angles, fov )
local view = {}
view.origin = pos-( angles:Forward()*100 )
view.angles = angles
view.fov = fov
view.drawviewer = true
return view
end
hook.Add( “CalcView”, “MyCalcView”, MyCalcView )