function MagnetoThrow()
-- Nice and easy, turn it slow 180
timer.Simple(.02,Turn)
timer.Simple(.04,Turn)
timer.Simple(.06,Turn)
timer.Simple(.08,Turn)
timer.Simple(.10,Turn)
timer.Simple(.12,Turn)
timer.Simple(.14,Turn)
timer.Simple(.16,Turn)
timer.Simple(.18,Turn)
timer.Simple(.20,Turn)
timer.Simple(.22,Turn)
timer.Simple(.24,Turn)
timer.Simple(.26,Turn)
timer.Simple(.28,Turn)
timer.Simple(.30,Turn)
timer.Simple(.32,Turn)
timer.Simple(.34,Turn)
timer.Simple(.36,Turn)
-- OH MY GOD WHIP AROUND 180
timer.Simple(.46,TurnBack)
-- And deliver the final blow by pressing right click
timer.Simple(.7,function() RunConsoleCommand("+attack") end)
timer.Simple(.72,function() RunConsoleCommand("-attack") end)
end
function Turn()
-- Turn function
LocalPlayer():SetEyeAngles(LocalPlayer():EyeAngles()-Angle(0,10,0))
end
function TurnBack()
-- Turn 180 function
LocalPlayer():SetEyeAngles(LocalPlayer():EyeAngles()-Angle(0,180,0))
end
-- Making it a console command
concommand.Add("ThrowMagneto",MagnetoThrow)

--------------------------------------------------
-- prop_kill.lua ("prop_kill")
-- Prop kill script for Garry's Mod
--
-- Version: A - 1.0
-- Author: Chronode
-- Year: 2013
-- License: Lua 5.2 Terms and Conditions
--------------------------------------------------
-- Check for client
if not CLIENT then return;
end;
-- Create console variables
CreateClientConVar("propkill", 0, true, false);
CreateClientConVar("propkill_model", "models/barrel.mdl", true, false);
--- prop_kill(string name)
--@ param - name: Name of prop
--@ returns: true if prop spawned, false otherwise
function prop_kill(name)
--# data
local prop = ents.Create("prop_physics");
local speed = GetConVar("physgun_wheelspeed"):GetString();
local vector = LocalPlayer():GetAimVector();
local position = EyePos() + Vector(math.cos(vector.x) * 10, 0, math.sin(vector.z) * 10);
--# code
RunConsoleCommand("physgun_wheelspeed", "300.0");
-- Client prop code
prop:SetModel(GetConVar("propkill_model"):GetString());
prop:SetPos(position);
prop:SetAngles(EyeAngles());
prop:Spawn();
-- Just in case...
if not prop:Valid() then return false;
end;
-- (Violently) Fling the prop.
LocalPlayer():SelectWeapon("weapon_physgun");
RunConsoleCommand("+attack");
RunConsoleCommand("invnext");
RunConsoleCommand("-attack");
RunConsoleCommand("physgun_wheelspeed", speed);
-- Finally, give the thumbs up
return true;
end;
-- Add our hook
hook.Add("Think", "propkill", function()
if GetConVar("propkill"):GetBool() then
prop_kill(GetConVar("propkill_model"):GetString());
RunConsoleCommand("propkill", "0");
end;
end;);
