Just a simple weapon dupe for servers that have /sleep, timers work for me if they don't for you go to line 38+ and edit them there. It also includes an entity aimbot so if you want to automate this you can just let it run.
This was designed to work with the scriptfodder inventory mod, script 54.
Installation guide:
Put the code into a .lua file and name it dropscript.lua
Put the file in C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\garrysmod\l ua" or where ever your \lua file is.
Bypass sv_allowcslua 1
Open console (`) lua_openscript_cl dropscript.lua
Bind <key> "drop"
Code:
-- Made by Promptitude
local function weaponAimbot()
for k, v in pairs(ents.GetAll()) do
if IsValid(v) && string.find(v:GetClass(), "spawned_weapon") && v:GetPos():DistToSqr(LocalPlayer():GetPos()) < 5625 then
LocalPlayer():SetEyeAngles((v:GetPos() - LocalPlayer():GetShootPos()):Angle())
timer.Simple(0.1, function() RunConsoleCommand("+forward") end)
timer.Simple(0.3, function() RunConsoleCommand("-forward") end)
timer.Simple(0.5, function() RunConsoleCommand("slot2") end)
timer.Simple(0.5, function() RunConsoleCommand("slot2") end)
timer.Simple(0.5, function() RunConsoleCommand("slot2") end)
timer.Simple(0.6, function() RunConsoleCommand("+attack") end)
timer.Simple(0.7, function() RunConsoleCommand("-attack") end)
timer.Simple(0.8, function() LocalPlayer():SetEyeAngles((v:GetPos() - LocalPlayer():GetShootPos()):Angle()) end)
timer.Simple(0.9, function() RunConsoleCommand("+attack") end)
timer.Simple(1, function() RunConsoleCommand("-attack") end)
end
end
end
local function slotSelector()
timer.Simple(0.1, function() RunConsoleCommand("slot2") end)
timer.Simple(0.2, function() RunConsoleCommand("slot2") end)
timer.Simple(0.3, function() RunConsoleCommand("slot2") end)
timer.Simple(0.4, function() RunConsoleCommand("slot4") end)
timer.Simple(0.5, function() RunConsoleCommand("+attack") end)
timer.Simple(0.6, function() RunConsoleCommand("-attack") end)
end
local function resetScript()
timer.Simple(0.1, function() RunConsoleCommand("slot1") end)
timer.Simple(0.2, function() RunConsoleCommand("+attack") end)
timer.Simple(0.3, function() RunConsoleCommand("-attack") end)
end
concommand.Add("dupe", function()
sound.Play("Grenade.Blip", LocalPlayer():GetPos(), 75, 100, 1)
chat.AddText(Color(255,0,0),"Duping Script Enabled.")
slotSelector()
timer.Simple(0.91, function() RunConsoleCommand("say", "/drop") end) -- Change the timing on the lines below this.
timer.Simple(1.9, function() RunConsoleCommand("say","/sleep") end)
timer.Simple(7.5, function() RunConsoleCommand("say","/sleep") end)
timer.Simple(8.5, weaponAimbot)
timer.Simple(10, resetScript)
end)
If you're going to copy and paste this into your own code at least don't remove the credit.