--almost all of the code here was "borrowed" from Royall's sniper laser script, knowing when you're dead --and properly cleaning up is quite important for any script applied directly to bots. --Trace is from a sample script written by Bazooks --This script is based on Parachute_Auto_Deploy, another script of mine --bots will need autojumps to utilize this script, due to it directly setting velocity --this script does not come with much innate cosmetic flair, you'll need to provide some of that yourself popfile-side --I'd recommend adding a jetpack cosmetic, like the jupiter jetpack and maybe throw in some unusual effects on some shoe cosmetics --this script can be specialized into some fun gimmicks like manntreads bombing or sentry buster tomfoolery, if you so wish --if you want to get started on that sort of thing, check "trace" under globals.lua local function removeCallbacks(player, callbacks) if not IsValid(player) then return end for _, callbackId in pairs(callbacks) do player:RemoveCallback(callbackId) end end function CheckGround(_, activator) local callbacks = {} local check local terminated = false local Zvalue local function terminate() if terminated then return end terminated = true timer.Stop(check) removeCallbacks(activator, callbacks) end check = timer.Create(0.015, function() if not IsValid(activator) or not activator:IsAlive() then terminate() return end local TraceDownwards = { start = activator, -- Start position vector. Can also be set to entity, in this case the trace will start from entity eyes position endpos = nil, -- End position vector. If nil, the trace will be fired in `angles` direction with `distance` length distance = 8192, -- Used if endpos is nil angles = Vector(90,0,0), -- Used if endpos is nil mask = MASK_SOLID, -- Solid type mask, see MASK_* globals collisiongroup = COLLISION_GROUP_DEBRIS, -- Pretend the trace to be fired by an entity belonging to this group. See COLLISION_GROUP_* globals mins = Vector(0,0,0), -- Extends the size of the trace in negative direction maxs = Vector(0,0,0), -- Extends the size of the trace in positive direction filter = nil -- Entity to ignore. Can be a single entity, table of entities, or a function with a single entity parameter } local TraceUpwards = { start = activator, -- Start position vector. Can also be set to entity, in this case the trace will start from entity eyes position endpos = nil, -- End position vector. If nil, the trace will be fired in `angles` direction with `distance` length distance = 300, -- Used if endpos is nil angles = Vector(180,0,0), -- Used if endpos is nil mask = MASK_SOLID, -- Solid type mask, see MASK_* globals collisiongroup = COLLISION_GROUP_DEBRIS, -- Pretend the trace to be fired by an entity belonging to this group. See COLLISION_GROUP_* globals mins = Vector(0,0,0), -- Extends the size of the trace in negative direction maxs = Vector(0,0,0), -- Extends the size of the trace in positive direction filter = nil -- Entity to ignore. Can be a single entity, table of entities, or a function with a single entity parameter } local eyeAngles = getEyeAngles(activator) local TraceForwards = { start = activator, -- Start position vector. Can also be set to entity, in this case the trace will start from entity eyes position endpos = nil, -- End position vector. If nil, the trace will be fired in `angles` direction with `distance` length distance = 5, -- Used if endpos is nil angles = eyeAngles, -- Used if endpos is nil mask = MASK_SOLID, -- Solid type mask, see MASK_* globals collisiongroup = COLLISION_GROUP_DEBRIS, -- Pretend the trace to be fired by an entity belonging to this group. See COLLISION_GROUP_* globals mins = Vector(0,0,0), -- Extends the size of the trace in negative direction maxs = Vector(0,0,0), -- Extends the size of the trace in positive direction filter = nil -- Entity to ignore. Can be a single entity, table of entities, or a function with a single entity parameter } local downTraceTable = util.Trace(TraceDownwards) ZvalueDown = downTraceTable["StartPos"] - downTraceTable["HitPos"] - 68 local UpTraceTable = util.Trace(TraceUpwards) --ceiling check local ForwardTraceTable = util.Trace(TraceForwards) --face against overpass check if ZvalueDown[3] >= 300 and UpTraceTable["Hit"] == false and ForwardTraceTable["Hit"] == false then activator:AddCond(80) --adds parachute, makes them fall slower and allows the bot to more easily comprehend that it is flying --print ("deploy parachute") end if ZvalueDown[3] < 200 and UpTraceTable["Hit"] == false and ForwardTraceTable["Hit"] == false then --print ("Ascend") activator:AddOutput("BaseVelocity 0 0 50") --it looks quite silly at higher values activator:RemoveCond(80) activator:SetForwardVelocity(200) --this is the bot's aerial movement speed, adjust to let them move faster or slower on the not Z axis end end, 0) callbacks.died = activator:AddCallback(ON_DEATH, function() terminate() end) callbacks.removed = activator:AddCallback(ON_REMOVE, function() terminate() end) callbacks.spawned = activator:AddCallback(ON_SPAWN, function() terminate() end) end