• deathcam help
    0 replies, posted
hey, im not a expert in lua, not even close to expert but im trying to learn so i got this code [CODE]if !ConVarExists("deathcam_firstperson") then CreateConVar("deathcam_firstperson", '1', (FCVAR_GAMEDLL), "to toggle first person.", true, true) end if GetConVarNumber("deathcam_firstperson") == 1 then victim:Spectate(OBS_MODE_DEATHCAM) timer.Create( "Freeze", 1.5, 1, function() victim:Spectate(OBS_MODE_IN_EYE) victim:SpectateEntity( killer ) end) end[/CODE] so when you die, you see who killed you with firstperson mode on the killer. but the thing is when i spawn the deathcam wont turn off. i tried to do something like this... but its not working too (part of my gamemode) [CODE]function GM:PlayerDeathThink( ply ) if ( ply.NextSpawnTime && ply.NextSpawnTime > CurTime() ) then return end if ( ply:KeyPressed( IN_ATTACK ) || ply:KeyPressed( IN_ATTACK2 ) || ply:KeyPressed( IN_JUMP ) && ( ply:GetPData( "Player_Class", "noclass" ) != "noclass") ) then ply:Spectate(OBS_MODE_NONE) ply:SpectateEntity() ply:UnSpectate() ply:Spawn() end if ( !ply:Alive() && (ply.NextSpawnTime + 3) < CurTime() && (player_manager.GetPlayerClass( ply ) != "noclass")) then ply:Spawn() end end[/CODE] can somebody help me?
Sorry, you need to Log In to post a reply to this thread.