Hello. I was looking for a lightsaber, but there only appears to be one in third person ("STAR WARS Lightsabers"). I need it in 1st person, something like here:
[QUOTE=ShoTGuNGuY49;21911201]Like this?
[img_thumb]http://filesmelt.com/dl/rp_stardestroyer0004.jpg[/img_thumb]
[img_thumb]http://filesmelt.com/dl/rp_stardestroyer0007.jpg[/img_thumb][/QUOTE]
Those seem to be the relevant functions from [i]weapon_lightsaber.lua[/i]:
[lua]hook.Add( "ShouldDrawLocalPlayer", "rb655_lightsaber_weapon_draw", function()
if ( IsValid( LocalPlayer() ) && IsValid( LocalPlayer():GetActiveWeapon() ) && LocalPlayer():GetActiveWeapon():GetClass() == "weapon_lightsaber" && !LocalPlayer():InVehicle() && LocalPlayer():Alive() && LocalPlayer():GetViewEntity() == LocalPlayer() ) then return true end
end )
function SWEP:CalcView( ply, pos, ang, fov )
if ( !IsValid( ply ) || !ply:Alive() || ply:InVehicle() || ply:GetViewEntity() != ply ) then return end
local trace = util.TraceLine( {
start = pos,
endpos = pos - ang:Forward() * 124,
filter = { ply:GetActiveWeapon(), ply }
} )
if ( trace.Hit ) then pos = trace.HitPos + ang:Forward() * 24 else pos = pos - ang:Forward() * 100 end
return pos, ang, fov
end[/lua]
Full [i]weapon_lightsaber.lua[/i]: [url]http://pastebin.com/sxmxp8k4[/url]
"STAR WARS Lightsabers": [url]http://steamcommunity.com/sharedfiles/filedetails/?id=111412589[/url]
No.
Try just removing that section and see what happens.
[QUOTE=capnsparrow;41571374]Try just removing that section and see what happens.[/QUOTE]
Default: [url]http://i.imgur.com/pAE9Klv.jpg[/url]
Commenting out both: 1st person, but instead of a lightsaber I see the crowbar without animations: [url]http://i.imgur.com/hEmQGw0.jpg[/url]
Commenting out [i]ShouldDrawLocalPlayer[/i] hook: same as above, just in 3rd person: [url]http://i.imgur.com/RkNePFx.jpg[/url]
Commenting out [i]CalcView[/i]: 3rd person lightsaber, just much closer to the player: [url]http://i.imgur.com/ED5bv4H.jpg[/url]
That's because it was never designed for that.
Sorry, you need to Log In to post a reply to this thread.