-- ModuleScript ActiveCast (via decompile) local _ = require(script.Parent.TypeDefinitions) local TypeMarshaller_upv_1 = require(script.Parent.TypeMarshaller) local tbl_upv_1 = {} tbl_upv_1.__index = tbl_upv_1 tbl_upv_1.__type = "ActiveCast" local RunService_upv_1 = game:GetService("RunService") local Table_upv_1 = require(script.Parent.Table) local u1 = nil local function GetFastCastVisualizationContainer() --[[ name: GetFastCastVisualizationContainer line: 62 ]] local FastCastVisualizationObjects_1 = workspace.Terrain:FindFirstChild("FastCastVisualizationObjects") if FastCastVisualizationObjects_1 ~= nil then return FastCastVisualizationObjects_1 end local v1 = Instance.new("Folder") v1.Name = "FastCastVisualizationObjects" v1.Archivable = false v1.Parent = workspace.Terrain return v1 end function DbgVisualizeSegment(a1, a2) --[[ name: DbgVisualizeSegment line: 86 upvalues: u1 (ref, index: 1) ]] if u1.VisualizeCasts ~= true then return nil end local v2 = Instance.new("ConeHandleAdornment") v2.Adornee = workspace.Terrain v2.CFrame = a1 v2.Height = a2 v2.Color3 = Color3.new() v2.Radius = 0.25 v2.Transparency = 0.5 local v3 = workspace.Terrain:FindFirstChild("FastCastVisualizationObjects") if v3 == nil then v3 = Instance.new("Folder") v3.Name = "FastCastVisualizationObjects" v3.Archivable = false v3.Parent = workspace.Terrain end v2.Parent = v3 return v2 end function DbgVisualizeHit(a1, a2) --[[ name: DbgVisualizeHit line: 102 upvalues: u1 (ref, index: 1) ]] if u1.VisualizeCasts ~= true then return nil end local v4 = Instance.new("SphereHandleAdornment") v4.Adornee = workspace.Terrain v4.CFrame = a1 v4.Radius = 0.4 v4.Transparency = 0.25 v4.Color3 = a2 == false and Color3.new(0.2, 1, 0.5) or Color3.new(1, 0.2, 0.2) local v6 = workspace.Terrain:FindFirstChild("FastCastVisualizationObjects") if v6 == nil then v6 = Instance.new("Folder") v6.Name = "FastCastVisualizationObjects" v6.Archivable = false v6.Parent = workspace.Terrain end v4.Parent = v6 return v4 end local function GetPositionAtTime(a1, a2, a3, a4) --[[ name: GetPositionAtTime line: 124 ]] return (a2 + (a3 * a1)) + Vector3.new((a4.X * (a1 ^ 2)) / 2, (a4.Y * (a1 ^ 2)) / 2, (a4.Z * (a1 ^ 2)) / 2) end local function GetVelocityAtTime(a1, a2, a3) --[[ name: GetVelocityAtTime line: 136 ]] return a2 + (a3 * a1) end local function GetTrajectoryInfo(a1, a2) --[[ name: GetTrajectoryInfo line: 140 ]] assert(a1.StateInfo.UpdateConnection ~= nil, "This ActiveCast has been terminated. It can no longer be used.") local v7 = a1.StateInfo.Trajectories[a2] local v8 = v7.EndTime - v7.StartTime local InitialVelocity_1 = v7.InitialVelocity local Acceleration_1 = v7.Acceleration return {(v7.Origin + (InitialVelocity_1 * v8)) + Vector3.new((Acceleration_1.X * (v8 ^ 2)) / 2, (Acceleration_1.Y * (v8 ^ 2)) / 2, (Acceleration_1.Z * (v8 ^ 2)) / 2), InitialVelocity_1 + (Acceleration_1 * v8)} end local function GetLatestTrajectoryEndInfo(a1) --[[ name: GetLatestTrajectoryEndInfo line: 153 upvalues: GetTrajectoryInfo (copy, index: 1) ]] assert(a1.StateInfo.UpdateConnection ~= nil, "This ActiveCast has been terminated. It can no longer be used.") return (GetTrajectoryInfo(a1, #a1.StateInfo.Trajectories)) end local function CloneCastParams(a1) --[[ name: CloneCastParams line: 158 ]] local v9 = RaycastParams.new() v9.CollisionGroup = a1.CollisionGroup v9.FilterType = a1.FilterType v9.FilterDescendantsInstances = a1.FilterDescendantsInstances v9.IgnoreWater = a1.IgnoreWater return v9 end local function SendRayFinalHit(a1, a2, a3, a4, a5, a6) --[[ name: SendRayFinalHit line: 167 ]] a1.Caster.RayFinalHit:Fire(a1, a2, a3, a4, a5, a6) end local function SendRayHit(a1, a2, a3, a4, a5, a6) --[[ name: SendRayHit line: 179 ]] a1.Caster.RayHit:Fire(a1, a2, a3, a4, a5, a6) end local function SendLengthChanged(a1, a2, a3, a4, a5, a6, a7) --[[ name: SendLengthChanged line: 191 ]] a1.Caster.LengthChanged:Fire(a1, a2, a3, a4, a5, a6, a7) end local function SimulateHitscan(a1, a2, a3, a4, a5) --[[ name: SimulateHitscan line: 735 upvalues: Table_upv_1 (copy, index: 1) SimulateHitscan (copy, index: 3) ]] local WorldRoot_1 = a1.RayInfo.WorldRoot local v10 = WorldRoot_1:Raycast(a2, a3 * a5, a1.RayInfo.Parameters) local v11 = a2 + a3 * a5 local v12 = nil local _ = Vector3.new() if v10 then v11, v12 = v10.Position, v10.Instance end Table_upv_1.insert(a1.StateInfo.TweenTable, {s = 0, ready = false, origin = a2, direction = CFrame.new(a2, v11), lastPoint = a2, l = (a2 - v11).Magnitude}) if not v12 or v12 == a1.RayInfo.CosmeticBulletObject then return end if a1.RayInfo.CanPenetrateCallback == nil then local v13 = nil if a1.RayInfo.CanHitCallback ~= nil and a1.RayInfo.CanHitCallback(a1, a2, a3, v10, a4, a1.RayInfo.CosmeticBulletObject) ~= false then a1.Caster.RayHit:Fire(a1, a2, a3, v10, a4, a1.RayInfo.CosmeticBulletObject) v13 = DbgVisualizeHit(CFrame.new(v11), true) if v13 ~= nil then v13.Color3 = Color3.new(1, 0.113725, 0.588235) end SimulateHitscan(a1, v11, a1.RayInfo.ModifiedDirection, a4, a5) return end a1.Caster.RayFinalHit:Fire(a1, a2, a3, v10, a4, a1.RayInfo.CosmeticBulletObject) DbgVisualizeHit(CFrame.new(v11), false) else if a1.RayInfo.CanPenetrateCallback ~= nil and a1.RayInfo.CanPenetrateCallback(a1, a2, a3, v10, a4, a1.RayInfo.CosmeticBulletObject) == false then local v13 if a1.RayInfo.CanHitCallback == nil or a1.RayInfo.CanHitCallback(a1, a2, a3, v10, a4, a1.RayInfo.CosmeticBulletObject) == false then a1.Caster.RayFinalHit:Fire(a1, a2, a3, v10, a4, a1.RayInfo.CosmeticBulletObject) DbgVisualizeHit(CFrame.new(v11), false) return end a1.Caster.RayHit:Fire(a1, a2, a3, v10, a4, a1.RayInfo.CosmeticBulletObject) v13 = DbgVisualizeHit(CFrame.new(v11), true) if v13 ~= nil then v13.Color3 = Color3.new(1, 0.113725, 0.588235) end SimulateHitscan(a1, v11, a1.RayInfo.ModifiedDirection, a4, a5) return end DbgVisualizeHit(CFrame.new(v11), true) local Parameters_1 = a1.RayInfo.Parameters local tbl_2 = {} local v14 = 0 local FilterDescendantsInstances_1 = Parameters_1.FilterDescendantsInstances local v15 = false local v16 = nil while true do if v10.Instance:IsA("Terrain") then if Enum.Material.Air == Enum.Material.Water then a1:Terminate() error("Do not add Water as a piercable material. If you need to penetrate water, set cast.RayInfo.Parameters.IgnoreWater = true instead", 0) end warn("WARNING: The penetrate callback for this cast returned TRUE on Terrain! This can cause severely adverse effects.") end if Parameters_1.FilterType ~= Enum.RaycastFilterType.Blacklist then local FilterDescendantsInstances_2 = Parameters_1.FilterDescendantsInstances Table_upv_1.removeObject(FilterDescendantsInstances_2, v10.Instance) Table_upv_1.insert(tbl_2, v10.Instance) Parameters_1.FilterDescendantsInstances = FilterDescendantsInstances_2 else local FilterDescendantsInstances_3 = Parameters_1.FilterDescendantsInstances Table_upv_1.insert(FilterDescendantsInstances_3, v10.Instance) Table_upv_1.insert(tbl_2, v10.Instance) Parameters_1.FilterDescendantsInstances = FilterDescendantsInstances_3 end v10 = WorldRoot_1:Raycast(a2, a3, Parameters_1) if v10 ~= nil then if v14 >= 100 then warn("WARNING: Exceeded maximum penetrate test budget for a single ray segment (attempted to test the same segment " .. 100 .. " times!)") else v14 = v14 + 1 if a1.RayInfo.CanPenetrateCallback(a1, a2, a3, v10, a4, a1.RayInfo.CosmeticBulletObject) ~= false then continue end v15 = true end end a1.RayInfo.Parameters.FilterDescendantsInstances = FilterDescendantsInstances_1 if v15 then if a1.RayInfo.CanHitCallback == nil or a1.RayInfo.CanHitCallback(a1, a2, a3, v10, a4, a1.RayInfo.CosmeticBulletObject) == false then local v17 = "Broke because the ray hit something solid (" .. tostring(v10.Instance) .. ") while testing for a penetration. Terminating the cast." a1.Caster.RayFinalHit:Fire(a1, a2, a3, v10, a4, a1.RayInfo.CosmeticBulletObject) DbgVisualizeHit(CFrame.new(v10.Position), false) return end a1.Caster.RayHit:Fire(a1, a2, a3, v10, a4, a1.RayInfo.CosmeticBulletObject) v16 = DbgVisualizeHit(CFrame.new(v11), true) if v16 ~= nil then v16.Color3 = Color3.new(1, 0.113725, 0.588235) end SimulateHitscan(a1, v11, a1.RayInfo.ModifiedDirection, a4, a5) else SimulateHitscan(a1, v11 + (a3 * 0.01), a3, a4, a5 - (a2 - v11).Magnitude) end return end end end local function SimulateCast(a1, a2, a3) --[[ name: SimulateCast line: 213 upvalues: Table_upv_1 (copy, index: 2) ]] assert(a1.StateInfo.UpdateConnection ~= nil, "This ActiveCast has been terminated. It can no longer be used.") local v17 = a1.StateInfo.Trajectories[#a1.StateInfo.Trajectories] local Origin_upv_1 = v17.Origin local v18 = a1.StateInfo.TotalRuntime - v17.StartTime local InitialVelocity_2 = v17.InitialVelocity local Acceleration_2 = v17.Acceleration local u2 = Origin_upv_1 + (InitialVelocity_2 * v18) + Vector3.new((Acceleration_2.X * (v18 ^ 2)) / 2, (Acceleration_2.Y * (v18 ^ 2)) / 2, (Acceleration_2.Z * (v18 ^ 2)) / 2) local v19 = a1.StateInfo.TotalRuntime - v17.StartTime a1.StateInfo.Delta = a2 local StateInfo_1 = a1.StateInfo StateInfo_1.TotalRuntime = StateInfo_1.TotalRuntime + a2 local StateInfo_2 = a1.StateInfo StateInfo_2.TotalRuntime2 = StateInfo_2.TotalRuntime2 + a2 local v20 = a1.StateInfo.TotalRuntime - v17.StartTime local v21 = Origin_upv_1 + (InitialVelocity_2 * v20) + Vector3.new((Acceleration_2.X * (v20 ^ 2)) / 2, (Acceleration_2.Y * (v20 ^ 2)) / 2, (Acceleration_2.Z * (v20 ^ 2)) / 2) local u3 = InitialVelocity_2 + Acceleration_2 * v20 local u4 = (v21 - u2).Unit * u3.Magnitude * a2 local WorldRoot_upv_2 = a1.RayInfo.WorldRoot local u5 = nil local Position_upv_1 = v21 local v22 = nil local u6 = Enum.Material.Air local _ = Vector3.new() if a1.RayInfo.RaycastHitbox then for v39, value_1 in next, a1.RayInfo.RaycastHitbox do u5 = WorldRoot_upv_2:Raycast((a1.RayInfo.CurrentCFrame * value_1).p, u4, a1.RayInfo.Parameters) if u5 ~= nil then Position_upv_1 = u5.Position local Instance_1 = u5.Instance u6 = u5.Material v22 = Instance_1 break end end else u5 = WorldRoot_upv_2:Raycast(u2, u4, a1.RayInfo.Parameters) if u5 ~= nil then Position_upv_1 = u5.Position local Instance_2 = u5.Instance u6 = u5.Material v22 = Instance_2 end end local Magnitude_upv_1 = ((((a1.RayInfo.RaycastHitbox) and v21) or Position_upv_1) - u2).Magnitude a1.Caster.LengthChanged:Fire(a1, ((a1.RayInfo.RaycastHitbox) and v21) or Position_upv_1, u2, u4.Unit, Magnitude_upv_1, u3, a1.RayInfo.CosmeticBulletObject) local v23 = a1.StateInfo v23.DistanceCovered = v23.DistanceCovered + Magnitude_upv_1 v23 = nil if a2 > 0 then v23 = DbgVisualizeSegment(CFrame.new(u2, u2 + u4), Magnitude_upv_1) end if v22 then if v22 == a1.RayInfo.CosmeticBulletObject then if a1.RayInfo.TravelType ~= "Distance" then if a1.RayInfo.Lifetime < a1.StateInfo.TotalRuntime2 then if a1.UserData.CastBehavior.HitEventOnTermination then a1.Caster.RayFinalHit:Fire(a1, Origin_upv_1, u4.Unit, u5, u3, a1.RayInfo.CosmeticBulletObject) end a1:Terminate(nil, true) DbgVisualizeHit(CFrame.new(v21), false) end elseif a1.RayInfo.MaxDistance <= a1.StateInfo.DistanceCovered then if a1.UserData.CastBehavior.HitEventOnTermination then a1.Caster.RayFinalHit:Fire(a1, Origin_upv_1, u4.Unit, u5, u3, a1.RayInfo.CosmeticBulletObject) end a1:Terminate(nil, true) DbgVisualizeHit(CFrame.new(v21), false) end else local v40 = tick() if a1.RayInfo.CanPenetrateCallback ~= nil then if a3 == false and a1.StateInfo.IsActivelySimulatingPenetration then a1:Terminate() error("ERROR: The latest call to CanPenetrateCallback took too long to complete! This cast is going to suffer desyncs which WILL cause unexpected behavior and errors. Please fix your performance problems, or remove statements that yield (e.g. wait() calls)") end a1.StateInfo.IsActivelySimulatingPenetration = true end if a1.RayInfo.CanPenetrateCallback ~= nil then if a1.RayInfo.CanPenetrateCallback == nil then if v23 ~= nil then v23.Color3 = Color3.new(0.4, 0.05, 0.05) end DbgVisualizeHit(CFrame.new(Position_upv_1), true) local Parameters_upv_2 = a1.RayInfo.Parameters local tbl_upv_3 = {} local u7 = 0 local FilterDescendantsInstances_upv_4 = Parameters_upv_2.FilterDescendantsInstances local u8 = false local u9 = false local function Recursive_upv_1() --[[ name: Recursive line: 546 upvalues: Table_upv_1 (copy, index: 1) tbl_upv_3 (copy, index: 2) u7 (ref, index: 3) u8 (ref, index: 4) a1 (copy, index: 5) u5 (ref, index: 6) u6 (ref, index: 7) Parameters_upv_2 (copy, index: 8) WorldRoot_upv_2 (copy, index: 9) u2 (copy, index: 10) u4 (copy, index: 11) Origin_upv_1 (copy, index: 12) u3 (copy, index: 13) FilterDescendantsInstances_upv_4 (copy, index: 14) u9 (ref, index: 15) Position_upv_1 (ref, index: 16) Magnitude_upv_1 (copy, index: 17) Recursive_upv_1 (copy, index: 18) ]] Table_upv_1.clear(tbl_upv_3) u7 = 0 u8 = false a1.StateInfo.IsActivelySimulatingPenetration = true while true do local v24 = u5.Instance:IsA("Terrain") if v24 then if u6 == Enum.Material.Water then a1:Terminate() error("Do not add Water as a piercable material. If you need to penetrate water, set cast.RayInfo.Parameters.IgnoreWater = true instead", 0) end warn("WARNING: The penetrate callback for this cast returned TRUE on Terrain! This can cause severely adverse effects.") end if Parameters_upv_2.FilterType ~= Enum.RaycastFilterType.Blacklist then local FilterDescendantsInstances_5 = Parameters_upv_2.FilterDescendantsInstances Table_upv_1.removeObject(FilterDescendantsInstances_5, u5.Instance) Table_upv_1.insert(tbl_upv_3, u5.Instance) Parameters_upv_2.FilterDescendantsInstances = FilterDescendantsInstances_5 else local FilterDescendantsInstances_6 = Parameters_upv_2.FilterDescendantsInstances Table_upv_1.insert(FilterDescendantsInstances_6, u5.Instance) Table_upv_1.insert(tbl_upv_3, u5.Instance) Parameters_upv_2.FilterDescendantsInstances = FilterDescendantsInstances_6 end u5 = WorldRoot_upv_2:Raycast(u2, u4, Parameters_upv_2) if u5 ~= nil then if u7 >= 100 then warn("WARNING: Exceeded maximum penetrate test budget for a single ray segment (attempted to test the same segment " .. 100 .. " times!)") else u7 = u7 + 1 if a1.RayInfo.CanPenetrateCallback(a1, Origin_upv_1, u4.Unit, u5, u3, a1.RayInfo.CosmeticBulletObject) ~= false then continue end u8 = true end end a1.RayInfo.Parameters.FilterDescendantsInstances = FilterDescendantsInstances_upv_4 a1.StateInfo.IsActivelySimulatingPenetration = false if u8 then if a1.RayInfo.CanHitCallback == nil or a1.RayInfo.CanHitCallback(a1, Origin_upv_1, u4.Unit, u5, u3, a1.RayInfo.CosmeticBulletObject) == false then u9 = true return end a1.Caster.RayHit:Fire(a1, Origin_upv_1, u4.Unit, u5, u3, a1.RayInfo.CosmeticBulletObject) local v25 = DbgVisualizeHit(CFrame.new(Position_upv_1), true) if v25 ~= nil then v25.Color3 = Color3.new(1, 0.113725, 0.588235) end local v26 = DbgVisualizeSegment(CFrame.new(u2, u2 + u4), Magnitude_upv_1) if v26 ~= nil then v26.Color3 = Color3.new(0.305882, 0.243137, 0.329412) end Recursive_upv_1() end return end end Recursive_upv_1() if u9 then local v41 = "Broke because the ray hit something solid (" .. tostring(u5.Instance) .. ") while testing for a penetration. Terminating the cast." a1.Caster.RayFinalHit:Fire(a1, Origin_upv_1, u4.Unit, u5, u3, a1.RayInfo.CosmeticBulletObject) a1:Terminate(u5) DbgVisualizeHit(CFrame.new(u5.Position), false) elseif a1.RayInfo.TravelType ~= "Distance" then if a1.RayInfo.Lifetime < a1.StateInfo.TotalRuntime2 then if a1.UserData.CastBehavior.HitEventOnTermination then a1.Caster.RayFinalHit:Fire(a1, Origin_upv_1, u4.Unit, u5, u3, a1.RayInfo.CosmeticBulletObject) end a1:Terminate(nil, true) DbgVisualizeHit(CFrame.new(v21), false) end elseif a1.RayInfo.MaxDistance <= a1.StateInfo.DistanceCovered then if a1.UserData.CastBehavior.HitEventOnTermination then a1.Caster.RayFinalHit:Fire(a1, Origin_upv_1, u4.Unit, u5, u3, a1.RayInfo.CosmeticBulletObject) end a1:Terminate(nil, true) DbgVisualizeHit(CFrame.new(v21), false) end return end if a1.RayInfo.CanPenetrateCallback(a1, Origin_upv_1, u4.Unit, u5, u3, a1.RayInfo.CosmeticBulletObject) ~= false then if v23 ~= nil then v23.Color3 = Color3.new(0.4, 0.05, 0.05) end DbgVisualizeHit(CFrame.new(Position_upv_1), true) local Parameters_upv_2 = a1.RayInfo.Parameters local tbl_upv_3 = {} local u7 = 0 local FilterDescendantsInstances_upv_4 = Parameters_upv_2.FilterDescendantsInstances local u8 = false local u9 = false local function Recursive_upv_1() --[[ name: Recursive line: 546 upvalues: Table_upv_1 (copy, index: 1) tbl_upv_3 (copy, index: 2) u7 (ref, index: 3) u8 (ref, index: 4) a1 (copy, index: 5) u5 (ref, index: 6) u6 (ref, index: 7) Parameters_upv_2 (copy, index: 8) WorldRoot_upv_2 (copy, index: 9) u2 (copy, index: 10) u4 (copy, index: 11) Origin_upv_1 (copy, index: 12) u3 (copy, index: 13) FilterDescendantsInstances_upv_4 (copy, index: 14) u9 (ref, index: 15) Position_upv_1 (ref, index: 16) Magnitude_upv_1 (copy, index: 17) Recursive_upv_1 (copy, index: 18) ]] Table_upv_1.clear(tbl_upv_3) u7 = 0 u8 = false a1.StateInfo.IsActivelySimulatingPenetration = true while true do local v24 = u5.Instance:IsA("Terrain") if v24 then if u6 == Enum.Material.Water then a1:Terminate() error("Do not add Water as a piercable material. If you need to penetrate water, set cast.RayInfo.Parameters.IgnoreWater = true instead", 0) end warn("WARNING: The penetrate callback for this cast returned TRUE on Terrain! This can cause severely adverse effects.") end if Parameters_upv_2.FilterType ~= Enum.RaycastFilterType.Blacklist then local FilterDescendantsInstances_5 = Parameters_upv_2.FilterDescendantsInstances Table_upv_1.removeObject(FilterDescendantsInstances_5, u5.Instance) Table_upv_1.insert(tbl_upv_3, u5.Instance) Parameters_upv_2.FilterDescendantsInstances = FilterDescendantsInstances_5 else local FilterDescendantsInstances_6 = Parameters_upv_2.FilterDescendantsInstances Table_upv_1.insert(FilterDescendantsInstances_6, u5.Instance) Table_upv_1.insert(tbl_upv_3, u5.Instance) Parameters_upv_2.FilterDescendantsInstances = FilterDescendantsInstances_6 end u5 = WorldRoot_upv_2:Raycast(u2, u4, Parameters_upv_2) if u5 ~= nil then if u7 >= 100 then warn("WARNING: Exceeded maximum penetrate test budget for a single ray segment (attempted to test the same segment " .. 100 .. " times!)") else u7 = u7 + 1 if a1.RayInfo.CanPenetrateCallback(a1, Origin_upv_1, u4.Unit, u5, u3, a1.RayInfo.CosmeticBulletObject) ~= false then continue end u8 = true end end a1.RayInfo.Parameters.FilterDescendantsInstances = FilterDescendantsInstances_upv_4 a1.StateInfo.IsActivelySimulatingPenetration = false if u8 then if a1.RayInfo.CanHitCallback == nil or a1.RayInfo.CanHitCallback(a1, Origin_upv_1, u4.Unit, u5, u3, a1.RayInfo.CosmeticBulletObject) == false then u9 = true return end a1.Caster.RayHit:Fire(a1, Origin_upv_1, u4.Unit, u5, u3, a1.RayInfo.CosmeticBulletObject) local v25 = DbgVisualizeHit(CFrame.new(Position_upv_1), true) if v25 ~= nil then v25.Color3 = Color3.new(1, 0.113725, 0.588235) end local v26 = DbgVisualizeSegment(CFrame.new(u2, u2 + u4), Magnitude_upv_1) if v26 ~= nil then v26.Color3 = Color3.new(0.305882, 0.243137, 0.329412) end Recursive_upv_1() end return end end Recursive_upv_1() if u9 then local v41 = "Broke because the ray hit something solid (" .. tostring(u5.Instance) .. ") while testing for a penetration. Terminating the cast." a1.Caster.RayFinalHit:Fire(a1, Origin_upv_1, u4.Unit, u5, u3, a1.RayInfo.CosmeticBulletObject) a1:Terminate(u5) DbgVisualizeHit(CFrame.new(u5.Position), false) elseif a1.RayInfo.TravelType ~= "Distance" then if a1.RayInfo.Lifetime < a1.StateInfo.TotalRuntime2 then if a1.UserData.CastBehavior.HitEventOnTermination then a1.Caster.RayFinalHit:Fire(a1, Origin_upv_1, u4.Unit, u5, u3, a1.RayInfo.CosmeticBulletObject) end a1:Terminate(nil, true) DbgVisualizeHit(CFrame.new(v21), false) end elseif a1.RayInfo.MaxDistance <= a1.StateInfo.DistanceCovered then if a1.UserData.CastBehavior.HitEventOnTermination then a1.Caster.RayFinalHit:Fire(a1, Origin_upv_1, u4.Unit, u5, u3, a1.RayInfo.CosmeticBulletObject) end a1:Terminate(nil, true) DbgVisualizeHit(CFrame.new(v21), false) end return end end a1.StateInfo.IsActivelySimulatingPenetration = false if a1.StateInfo.HighFidelityBehavior ~= 2 or v17.Acceleration == Vector3.new() or a1.StateInfo.HighFidelitySegmentSize == 0 then if a1.StateInfo.HighFidelityBehavior ~= 1 and a1.StateInfo.HighFidelityBehavior ~= 3 then a1:Terminate() error("Invalid value " .. a1.StateInfo.HighFidelityBehavior .. " for HighFidelityBehavior.") if a1.RayInfo.TravelType ~= "Distance" then if a1.RayInfo.Lifetime < a1.StateInfo.TotalRuntime2 then if a1.UserData.CastBehavior.HitEventOnTermination then a1.Caster.RayFinalHit:Fire(a1, Origin_upv_1, u4.Unit, u5, u3, a1.RayInfo.CosmeticBulletObject) end a1:Terminate(nil, true) DbgVisualizeHit(CFrame.new(v21), false) end elseif a1.RayInfo.MaxDistance <= a1.StateInfo.DistanceCovered then if a1.UserData.CastBehavior.HitEventOnTermination then a1.Caster.RayFinalHit:Fire(a1, Origin_upv_1, u4.Unit, u5, u3, a1.RayInfo.CosmeticBulletObject) end a1:Terminate(nil, true) DbgVisualizeHit(CFrame.new(v21), false) end return end local v27, v28 = nil, nil if a1.RayInfo.CanHitCallback ~= nil and a1.RayInfo.CanHitCallback(a1, Origin_upv_1, u4.Unit, u5, u3, a1.RayInfo.CosmeticBulletObject) ~= false then a1.Caster.RayHit:Fire(a1, Origin_upv_1, u4.Unit, u5, u3, a1.RayInfo.CosmeticBulletObject) v27 = DbgVisualizeHit(CFrame.new(Position_upv_1), true) if v27 ~= nil then v27.Color3 = Color3.new(1, 0.113725, 0.588235) end v28 = DbgVisualizeSegment(CFrame.new(u2, u2 + u4), Magnitude_upv_1) if v28 ~= nil then v28.Color3 = Color3.new(0.305882, 0.243137, 0.329412) end if a1.RayInfo.TravelType ~= "Distance" then if a1.RayInfo.Lifetime < a1.StateInfo.TotalRuntime2 then if a1.UserData.CastBehavior.HitEventOnTermination then a1.Caster.RayFinalHit:Fire(a1, Origin_upv_1, u4.Unit, u5, u3, a1.RayInfo.CosmeticBulletObject) end a1:Terminate(nil, true) DbgVisualizeHit(CFrame.new(v21), false) end elseif a1.RayInfo.MaxDistance <= a1.StateInfo.DistanceCovered then if a1.UserData.CastBehavior.HitEventOnTermination then a1.Caster.RayFinalHit:Fire(a1, Origin_upv_1, u4.Unit, u5, u3, a1.RayInfo.CosmeticBulletObject) end a1:Terminate(nil, true) DbgVisualizeHit(CFrame.new(v21), false) end return end a1.Caster.RayFinalHit:Fire(a1, Origin_upv_1, u4.Unit, u5, u3, a1.RayInfo.CosmeticBulletObject) a1:Terminate(u5) DbgVisualizeHit(CFrame.new(Position_upv_1), false) else a1.StateInfo.CancelHighResCast = false if a1.StateInfo.IsActivelyResimulating then a1:Terminate() error("Cascading cast lag encountered! The caster attempted to perform a high fidelity cast before the previous one completed, resulting in exponential cast lag. Consider increasing HighFidelitySegmentSize.") end a1.StateInfo.IsActivelyResimulating = true local v29 = math.floor(Magnitude_upv_1 / a1.StateInfo.HighFidelitySegmentSize) local v30 = a2 / v29 local v31, v32, v33, v34 = nil, nil, nil, nil for n_1 = 1, v29 do local v35 = nil if a1.StateInfo.CancelHighResCast then a1.StateInfo.CancelHighResCast = false break end local v36 = v19 + v30 * n_1 local v37 = Origin_upv_1 + (InitialVelocity_2 * v36) + Vector3.new((Acceleration_2.X * (v36 ^ 2)) / 2, (Acceleration_2.Y * (v36 ^ 2)) / 2, (Acceleration_2.Z * (v36 ^ 2)) / 2) v31 = InitialVelocity_2 + Acceleration_2 * (v19 + (v30 * n_1)) v32 = v31 * a2 v33 = nil if a1.RayInfo.RaycastHitbox then for v42, value_2 in next, a1.RayInfo.RaycastHitbox do v33 = WorldRoot_upv_2:Raycast((a1.RayInfo.CurrentCFrame * value_2).p, v32, a1.RayInfo.Parameters) if v33 ~= nil then break else continue end end else v33 = WorldRoot_upv_2:Raycast(v37, v32, a1.RayInfo.Parameters) end if v33 == nil then v34 = DbgVisualizeSegment(CFrame.new(v37, v37 + v31), (v37 - (v37 + v31)).Magnitude) if v34 ~= nil then v34.Color3 = Color3.new(0.286275, 0.329412, 0.247059) end else v35 = DbgVisualizeSegment(CFrame.new(v37, v37 + v31), (v37 - v33.Position).Magnitude) if v35 ~= nil then v35.Color3 = Color3.new(0.286275, 0.329412, 0.247059) end if a1.RayInfo.CanPenetrateCallback == nil then local v38 = nil if a1.RayInfo.CanHitCallback ~= nil and (a1.RayInfo.CanHitCallback == nil or a1.RayInfo.CanHitCallback(a1, Origin_upv_1, v32.Unit, v33, v31, a1.RayInfo.CosmeticBulletObject) ~= false) then a1.Caster.RayHit:Fire(a1, Origin_upv_1, v32.Unit, v33, v31, a1.RayInfo.CosmeticBulletObject) v38 = DbgVisualizeHit(CFrame.new(Position_upv_1), true) if v38 ~= nil then v38.Color3 = Color3.new(1, 0.113725, 0.588235) end if v35 ~= nil then v35.Color3 = Color3.new(0.305882, 0.243137, 0.329412) end end else if a1.RayInfo.CanPenetrateCallback == nil or a1.RayInfo.CanPenetrateCallback(a1, Origin_upv_1, v32.Unit, v33, v31, a1.RayInfo.CosmeticBulletObject) ~= false then continue end local v38 = nil if a1.RayInfo.CanHitCallback ~= nil and (a1.RayInfo.CanHitCallback == nil or a1.RayInfo.CanHitCallback(a1, Origin_upv_1, v32.Unit, v33, v31, a1.RayInfo.CosmeticBulletObject) ~= false) then a1.Caster.RayHit:Fire(a1, Origin_upv_1, v32.Unit, v33, v31, a1.RayInfo.CosmeticBulletObject) v38 = DbgVisualizeHit(CFrame.new(Position_upv_1), true) if v38 ~= nil then v38.Color3 = Color3.new(1, 0.113725, 0.588235) end if v35 ~= nil then v35.Color3 = Color3.new(0.305882, 0.243137, 0.329412) end end end end a1.StateInfo.IsActivelyResimulating = false a1.Caster.RayFinalHit:Fire(a1, Origin_upv_1, v32.Unit, v33, v31, a1.RayInfo.CosmeticBulletObject) a1:Terminate(v33) v34 = DbgVisualizeHit(CFrame.new(Position_upv_1), false) if v34 ~= nil then v34.Color3 = Color3.new(0.0588235, 0.87451, 1) end return end a1.StateInfo.IsActivelyResimulating = false if a1.RayInfo.TravelType ~= "Distance" then if a1.RayInfo.Lifetime < a1.StateInfo.TotalRuntime2 then if a1.UserData.CastBehavior.HitEventOnTermination then a1.Caster.RayFinalHit:Fire(a1, Origin_upv_1, u4.Unit, u5, u3, a1.RayInfo.CosmeticBulletObject) end a1:Terminate(nil, true) DbgVisualizeHit(CFrame.new(v21), false) end elseif a1.RayInfo.MaxDistance <= a1.StateInfo.DistanceCovered then if a1.UserData.CastBehavior.HitEventOnTermination then a1.Caster.RayFinalHit:Fire(a1, Origin_upv_1, u4.Unit, u5, u3, a1.RayInfo.CosmeticBulletObject) end a1:Terminate(nil, true) DbgVisualizeHit(CFrame.new(v21), false) end end end elseif a1.RayInfo.TravelType ~= "Distance" then if a1.RayInfo.Lifetime < a1.StateInfo.TotalRuntime2 then if a1.UserData.CastBehavior.HitEventOnTermination then a1.Caster.RayFinalHit:Fire(a1, Origin_upv_1, u4.Unit, u5, u3, a1.RayInfo.CosmeticBulletObject) end a1:Terminate(nil, true) DbgVisualizeHit(CFrame.new(v21), false) end elseif a1.RayInfo.MaxDistance <= a1.StateInfo.DistanceCovered then if a1.UserData.CastBehavior.HitEventOnTermination then a1.Caster.RayFinalHit:Fire(a1, Origin_upv_1, u4.Unit, u5, u3, a1.RayInfo.CosmeticBulletObject) end a1:Terminate(nil, true) DbgVisualizeHit(CFrame.new(v21), false) end end function tbl_upv_1.new(a1, a2, a3, a4, a5) --[[ name: new line: 960 upvalues: TypeMarshaller_upv_1 (copy, index: 1) Table_upv_1 (copy, index: 2) RunService_upv_1 (copy, index: 3) tbl_upv_1 (copy, index: 4) SimulateHitscan (copy, index: 5) SimulateCast (copy, index: 7) ]] if TypeMarshaller_upv_1(a4) == "number" then local _ = a3.Unit * a4 end if a5.HighFidelitySegmentSize <= 0 then error("Cannot set FastCastBehavior.HighFidelitySegmentSize <= 0!", 0) end local tbl_upv_4 = {UserData = 0, RayInfo = 0, StateInfo = 0} tbl_upv_4.Caster = a1 local tbl_5 = {TotalRuntime = 0, TotalRuntime2 = 0, Delta = 0, TweenTable = 0, Trajectories = 0, Paused = false, IsActivelySimulatingPenetration = false, DistanceCovered = 0, IsActivelyResimulating = false, CancelHighResCast = false} tbl_5.HighFidelitySegmentSize = a5.HighFidelitySegmentSize tbl_5.HighFidelityBehavior = a5.HighFidelityBehavior local u10 = {Acceleration = 0, EndTime = -1, StartTime = 0} u10.Origin = a2 u10.InitialVelocity = a4 u10.Acceleration = ((a5.Hitscan) and Vector3.new(0, 0, 0)) or (a5.Acceleration) tbl_5.Trajectories = {u10} tbl_5.TweenTable = {} tbl_upv_4.StateInfo = tbl_5 tbl_upv_4.RayInfo = {Parameters = a5.RaycastParams, WorldRoot = workspace, TravelType = a5.TravelType or "Distance", MaxDistance = a5.MaxDistance or 1000, Lifetime = a5.Lifetime or 5, CosmeticBulletObject = a5.CosmeticBulletTemplate, CanPenetrateCallback = a5.CanPenetrateFunction, CanHitCallback = a5.CanHitFunction, RaycastHitbox = a5.RaycastHitbox, CurrentCFrame = a5.CurrentCFrame, ModifiedDirection = a5.ModifiedDirection} tbl_upv_4.UserData = a5.UserData or {} if tbl_upv_4.StateInfo.HighFidelityBehavior == 2 then tbl_upv_4.StateInfo.HighFidelityBehavior = 3 end local u11 if tbl_upv_4.RayInfo.Parameters == nil then tbl_upv_4.RayInfo.Parameters = RaycastParams.new() else u10 = tbl_upv_4.RayInfo.Parameters u11 = RaycastParams.new() u11.CollisionGroup = u10.CollisionGroup u11.FilterType = u10.FilterType u11.FilterDescendantsInstances = u10.FilterDescendantsInstances u11.IgnoreWater = u10.IgnoreWater tbl_upv_4.RayInfo.Parameters = u11 end local v40 = false if a5.CosmeticBulletProvider ~= nil then if TypeMarshaller_upv_1(a5.CosmeticBulletProvider) ~= "PartCache" then warn("FastCastBehavior.CosmeticBulletProvider was not an instance of the PartCache module (an external/separate model)! Are you inputting an instance created via PartCache.new? If so, are you on the latest version of PartCache? Setting FastCastBehavior.CosmeticBulletProvider to nil.") a5.CosmeticBulletProvider = nil else if tbl_upv_4.RayInfo.CosmeticBulletObject ~= nil then warn("Do not define FastCastBehavior.CosmeticBulletTemplate and FastCastBehavior.CosmeticBulletProvider at the same time! The provider will be used, and CosmeticBulletTemplate will be set to nil.") tbl_upv_4.RayInfo.CosmeticBulletObject = nil a5.CosmeticBulletTemplate = nil end tbl_upv_4.RayInfo.CosmeticBulletObject = a5.CosmeticBulletProvider:GetPart() tbl_upv_4.RayInfo.CosmeticBulletObject.CFrame = CFrame.new(a2, a2 + a3) local v41 = nil if tbl_upv_4.RayInfo.CosmeticBulletObject:FindFirstChild("Initalized") then v41 = tbl_upv_4.RayInfo.CosmeticBulletObject:FindFirstChild("CoreTransparency") if v41 then tbl_upv_4.RayInfo.CosmeticBulletObject.Transparency = v41.Value end for _, value_3 in pairs(tbl_upv_4.RayInfo.CosmeticBulletObject:GetDescendants()) do if value_3:IsA("ParticleEmitter") or value_3:IsA("PointLight") or value_3:IsA("SurfaceLight") or value_3:IsA("SpotLight") or value_3:IsA("Trail") or value_3:IsA("Beam") or value_3:IsA("BillboardGui") or value_3:IsA("SurfaceGui") then value_3.Enabled = true continue end if value_3:IsA("Sound") then value_3:Play() continue end if value_3:IsA("Decal") or value_3:IsA("Texture") or value_3:IsA("BasePart") then local CurrentTransparency_1 = value_3:FindFirstChild("CurrentTransparency") if CurrentTransparency_1 then value_3.Transparency = CurrentTransparency_1.Value end end end else local v42 = Instance.new("BoolValue") v42.Name = "Initalized" v42.Parent = tbl_upv_4.RayInfo.CosmeticBulletObject local v43 = Instance.new("NumberValue") v43.Name = "CoreTransparency" v43.Value = tbl_upv_4.RayInfo.CosmeticBulletObject.Transparency v43.Parent = tbl_upv_4.RayInfo.CosmeticBulletObject for _, value_4 in pairs(tbl_upv_4.RayInfo.CosmeticBulletObject:GetDescendants()) do if value_4:IsA("ParticleEmitter") or value_4:IsA("PointLight") or value_4:IsA("SurfaceLight") or value_4:IsA("SpotLight") or value_4:IsA("Trail") or value_4:IsA("Beam") or value_4:IsA("BillboardGui") or value_4:IsA("SurfaceGui") then value_4.Enabled = true continue end if value_4:IsA("Sound") then value_4:Play() continue end if value_4:IsA("Decal") or value_4:IsA("Texture") or value_4:IsA("BasePart") then local v44 = Instance.new("NumberValue") v44.Name = "CurrentTransparency" v44.Value = value_4.Transparency v44.Parent = value_4 end end end v40 = true end elseif tbl_upv_4.RayInfo.CosmeticBulletObject ~= nil then tbl_upv_4.RayInfo.CosmeticBulletObject = tbl_upv_4.RayInfo.CosmeticBulletObject:Clone() tbl_upv_4.RayInfo.CosmeticBulletObject.CFrame = CFrame.new(a2, a2 + a3) tbl_upv_4.RayInfo.CosmeticBulletObject.Parent = a5.CosmeticBulletContainer u11 = Instance.new("NumberValue") u11.Name = "CoreTransparency" u11.Value = tbl_upv_4.RayInfo.CosmeticBulletObject.Transparency u11.Parent = tbl_upv_4.RayInfo.CosmeticBulletObject for _, value_5 in pairs(tbl_upv_4.RayInfo.CosmeticBulletObject:GetDescendants()) do if value_5:IsA("ParticleEmitter") or value_5:IsA("PointLight") or value_5:IsA("SurfaceLight") or value_5:IsA("SpotLight") or value_5:IsA("Trail") or value_5:IsA("Beam") or value_5:IsA("BillboardGui") or value_5:IsA("SurfaceGui") then value_5.Enabled = true continue end if value_5:IsA("Sound") then value_5:Play() continue end if value_5:IsA("Decal") or value_5:IsA("Texture") or value_5:IsA("BasePart") then u11 = Instance.new("NumberValue") u11.Name = "CurrentTransparency" u11.Value = value_5.Transparency u11.Parent = value_5 end end end if v40 then u11 = a5.CosmeticBulletProvider.CurrentCacheParent else u11 = a5.CosmeticBulletContainer end if a5.AutoIgnoreContainer == true and u11 ~= nil then local FilterDescendantsInstances_7 = tbl_upv_4.RayInfo.Parameters.FilterDescendantsInstances if Table_upv_1.find(FilterDescendantsInstances_7, u11) == nil then Table_upv_1.insert(FilterDescendantsInstances_7, u11) tbl_upv_4.RayInfo.Parameters.FilterDescendantsInstances = FilterDescendantsInstances_7 end end if RunService_upv_1:IsClient() then u10 = RunService_upv_1.RenderStepped else u10 = RunService_upv_1.Heartbeat end setmetatable(tbl_upv_4, tbl_upv_1) if a5.Hitscan then local _ if TypeMarshaller_upv_1(a4) ~= "number" then u11 = a4 else _ = a3.Unit * a4 u11 = a3.Unit * a4 or a4 end SimulateHitscan(tbl_upv_4, a2, a3.Unit, u11, ((tbl_upv_4.RayInfo.TravelType == "Lifetime") and (u11.Magnitude * tbl_upv_4.RayInfo.Lifetime)) or (tbl_upv_4.RayInfo.MaxDistance)) task.spawn( function() --[[ line: 1193 upvalues: tbl_upv_4 (copy, index: 1) u10 (ref, index: 2) u11 (copy, index: 3) ]] for _, value_upv_6 in pairs(tbl_upv_4.StateInfo.TweenTable) do tbl_upv_4.StateInfo.UpdateConnection = u10:Connect( function(a6) --[[ line: 1195 upvalues: value_upv_6 (copy, index: 1) tbl_upv_4 (copy, index: 2) u11 (copy, index: 3) ]] if not (value_upv_6.ready) then tbl_upv_4.StateInfo.Delta = a6 local StateInfo_3 = tbl_upv_4.StateInfo StateInfo_3.TotalRuntime = StateInfo_3.TotalRuntime + a6 if value_upv_6.s >= 0 then local v47 = math.min(u11.Magnitude * value_upv_6.s, value_upv_6.l) local v48 = value_upv_6.direction * Vector3.new(0, 0, -v47) local Magnitude_2 = (v48 - value_upv_6.lastPoint).Magnitude tbl_upv_4.Caster.LengthChanged:Fire(tbl_upv_4, value_upv_6.lastPoint, v48, value_upv_6.direction.LookVector, Magnitude_2, value_upv_6.direction.LookVector * u11.Magnitude, tbl_upv_4.RayInfo.CosmeticBulletObject) if a6 > 0 then local _ = DbgVisualizeSegment(CFrame.new(value_upv_6.lastPoint, v48), Magnitude_2) end value_upv_6.lastPoint = v48 value_upv_6.ready = value_upv_6.l <= v47 end value_upv_6.s = value_upv_6.s + a6 end end ) repeat u10:Wait() until value_upv_6.ready tbl_upv_4.StateInfo.UpdateConnection:Disconnect() end tbl_upv_4:Terminate() end ) else tbl_upv_4.StateInfo.UpdateConnection = u10:Connect( function(a7) --[[ line: 1235 upvalues: tbl_upv_4 (copy, index: 1) SimulateCast (copy, index: 3) ]] if tbl_upv_4.StateInfo.Paused then return end local v49 = tbl_upv_4.StateInfo.Trajectories[#tbl_upv_4.StateInfo.Trajectories] if tbl_upv_4.StateInfo.HighFidelityBehavior ~= 3 or v49.Acceleration == Vector3.new() then SimulateCast(tbl_upv_4, a7, false) else local v50 = nil if tbl_upv_4.StateInfo.HighFidelitySegmentSize > 0 then v50 = tick() if tbl_upv_4.StateInfo.IsActivelyResimulating then tbl_upv_4:Terminate() error("Cascading cast lag encountered! The caster attempted to perform a high fidelity cast before the previous one completed, resulting in exponential cast lag. Consider increasing HighFidelitySegmentSize.") end tbl_upv_4.StateInfo.IsActivelyResimulating = true local Origin_2 = v49.Origin local v51 = tbl_upv_4.StateInfo.TotalRuntime - v49.StartTime local InitialVelocity_3 = v49.InitialVelocity local Acceleration_3 = v49.Acceleration local v52 = Origin_2 + (InitialVelocity_3 * v51) + Vector3.new((Acceleration_3.X * (v51 ^ 2)) / 2, (Acceleration_3.Y * (v51 ^ 2)) / 2, (Acceleration_3.Z * (v51 ^ 2)) / 2) local StateInfo_4 = tbl_upv_4.StateInfo StateInfo_4.TotalRuntime = StateInfo_4.TotalRuntime + a7 local v53 = tbl_upv_4.StateInfo.TotalRuntime - v49.StartTime local v54 = Origin_2 + (InitialVelocity_3 * v53) + Vector3.new((Acceleration_3.X * (v53 ^ 2)) / 2, (Acceleration_3.Y * (v53 ^ 2)) / 2, (Acceleration_3.Z * (v53 ^ 2)) / 2) local v55 = (v54 - v52).Unit * (InitialVelocity_3 + (Acceleration_3 * v53)).Magnitude * a7 local v56 = tbl_upv_4.RayInfo.WorldRoot local v57 = nil if tbl_upv_4.RayInfo.RaycastHitbox then local v58 = nil for _, value_7 in next, tbl_upv_4.RayInfo.RaycastHitbox do v58 = v56:Raycast((tbl_upv_4.RayInfo.CurrentCFrame * value_7).p, v55, tbl_upv_4.RayInfo.Parameters) v57 = v58 if v58 ~= nil then break else continue end end else v57 = v56:Raycast(v52, v55, tbl_upv_4.RayInfo.Parameters) end if v57 == nil then v56 = v54 else v56 = v57.Position end local StateInfo_5 = tbl_upv_4.StateInfo StateInfo_5.TotalRuntime = StateInfo_5.TotalRuntime - a7 v57 = math.floor((v56 - v52).Magnitude / tbl_upv_4.StateInfo.HighFidelitySegmentSize) if v57 == 0 then v57 = 1 end for _ = 1, v57 do if getmetatable(tbl_upv_4) == nil then return end if tbl_upv_4.StateInfo.CancelHighResCast then tbl_upv_4.StateInfo.CancelHighResCast = false break end SimulateCast(tbl_upv_4, a7 / v57, true) end if getmetatable(tbl_upv_4) ~= nil then tbl_upv_4.StateInfo.IsActivelyResimulating = false if not (tick() - v50 > 0.08) then return end warn("Extreme cast lag encountered! Consider increasing HighFidelitySegmentSize.") end else SimulateCast(tbl_upv_4, a7, false) end end end ) end return tbl_upv_4 end function tbl_upv_1.SetStaticFastCastReference(a1) --[[ name: SetStaticFastCastReference line: 1342 upvalues: u1 (ref, index: 1) ]] u1 = a1 end local function ModifyTransformation(a1, a2, a3, a4) --[[ name: ModifyTransformation line: 1348 upvalues: GetTrajectoryInfo (copy, index: 1) Table_upv_1 (copy, index: 2) ]] local Trajectories_1 = a1.StateInfo.Trajectories local v59 = Trajectories_1[#Trajectories_1] if v59.StartTime ~= a1.StateInfo.TotalRuntime then v59.EndTime = a1.StateInfo.TotalRuntime assert(a1.StateInfo.UpdateConnection ~= nil, "This ActiveCast has been terminated. It can no longer be used.") local v60, v61 = unpack(GetTrajectoryInfo(a1, #a1.StateInfo.Trajectories)) if a2 == nil then a2 = v61 end if a3 == nil then a3 = v59.Acceleration end if a4 == nil then a4 = v60 end Table_upv_1.insert(a1.StateInfo.Trajectories, {EndTime = -1, StartTime = a1.StateInfo.TotalRuntime, Origin = a4, InitialVelocity = a2, Acceleration = a3}) a1.StateInfo.CancelHighResCast = true else if a2 == nil then a2 = v59.InitialVelocity end if a3 == nil then a3 = v59.Acceleration end if a4 == nil then a4 = v59.Origin end v59.Origin = a4 v59.InitialVelocity = a2 v59.Acceleration = a3 end end function tbl_upv_1.SetVelocity(a1, a2) --[[ name: SetVelocity line: 1394 upvalues: tbl_upv_1 (copy, index: 1) ModifyTransformation (copy, index: 2) ]] local v62 = getmetatable(a1) == tbl_upv_1 assert(v62, ("Cannot statically invoke method '%s' - It is an instance method. Call it on an instance of this class created via %s"):format("SetVelocity", "ActiveCast.new(...)")) assert(a1.StateInfo.UpdateConnection ~= nil, "This ActiveCast has been terminated. It can no longer be used.") ModifyTransformation(a1, a2, nil, nil) end function tbl_upv_1.SetAcceleration(a1, a2) --[[ name: SetAcceleration line: 1400 upvalues: tbl_upv_1 (copy, index: 1) ModifyTransformation (copy, index: 2) ]] local v63 = getmetatable(a1) == tbl_upv_1 assert(v63, ("Cannot statically invoke method '%s' - It is an instance method. Call it on an instance of this class created via %s"):format("SetAcceleration", "ActiveCast.new(...)")) assert(a1.StateInfo.UpdateConnection ~= nil, "This ActiveCast has been terminated. It can no longer be used.") ModifyTransformation(a1, nil, a2, nil) end function tbl_upv_1.SetPosition(a1, a2) --[[ name: SetPosition line: 1406 upvalues: tbl_upv_1 (copy, index: 1) ModifyTransformation (copy, index: 2) ]] local v64 = getmetatable(a1) == tbl_upv_1 assert(v64, ("Cannot statically invoke method '%s' - It is an instance method. Call it on an instance of this class created via %s"):format("SetPosition", "ActiveCast.new(...)")) assert(a1.StateInfo.UpdateConnection ~= nil, "This ActiveCast has been terminated. It can no longer be used.") ModifyTransformation(a1, nil, nil, a2) end function tbl_upv_1.GetVelocity(a1) --[[ name: GetVelocity line: 1412 upvalues: tbl_upv_1 (copy, index: 1) ]] local v65 = getmetatable(a1) == tbl_upv_1 assert(v65, ("Cannot statically invoke method '%s' - It is an instance method. Call it on an instance of this class created via %s"):format("GetVelocity", "ActiveCast.new(...)")) assert(a1.StateInfo.UpdateConnection ~= nil, "This ActiveCast has been terminated. It can no longer be used.") local v66 = a1.StateInfo.Trajectories[#a1.StateInfo.Trajectories] return v66.InitialVelocity + (v66.Acceleration * (a1.StateInfo.TotalRuntime - v66.StartTime)) end function tbl_upv_1.GetAcceleration(a1) --[[ name: GetAcceleration line: 1423 upvalues: tbl_upv_1 (copy, index: 1) ]] local v67 = getmetatable(a1) == tbl_upv_1 assert(v67, ("Cannot statically invoke method '%s' - It is an instance method. Call it on an instance of this class created via %s"):format("GetAcceleration", "ActiveCast.new(...)")) assert(a1.StateInfo.UpdateConnection ~= nil, "This ActiveCast has been terminated. It can no longer be used.") return a1.StateInfo.Trajectories[#a1.StateInfo.Trajectories].Acceleration end function tbl_upv_1.GetPosition(a1) --[[ name: GetPosition line: 1430 upvalues: tbl_upv_1 (copy, index: 1) ]] local v68 = getmetatable(a1) == tbl_upv_1 assert(v68, ("Cannot statically invoke method '%s' - It is an instance method. Call it on an instance of this class created via %s"):format("GetPosition", "ActiveCast.new(...)")) assert(a1.StateInfo.UpdateConnection ~= nil, "This ActiveCast has been terminated. It can no longer be used.") local v69 = a1.StateInfo.Trajectories[#a1.StateInfo.Trajectories] local v70 = a1.StateInfo.TotalRuntime - v69.StartTime local Acceleration_4 = v69.Acceleration return (v69.Origin + (v69.InitialVelocity * v70)) + Vector3.new((Acceleration_4.X * (v70 ^ 2)) / 2, (Acceleration_4.Y * (v70 ^ 2)) / 2, (Acceleration_4.Z * (v70 ^ 2)) / 2) end function tbl_upv_1.AddVelocity(a1, a2) --[[ name: AddVelocity line: 1444 upvalues: tbl_upv_1 (copy, index: 1) ]] local v71 = getmetatable(a1) == tbl_upv_1 assert(v71, ("Cannot statically invoke method '%s' - It is an instance method. Call it on an instance of this class created via %s"):format("AddVelocity", "ActiveCast.new(...)")) assert(a1.StateInfo.UpdateConnection ~= nil, "This ActiveCast has been terminated. It can no longer be used.") a1:SetVelocity(a1:GetVelocity() + a2) end function tbl_upv_1.AddAcceleration(a1, a2) --[[ name: AddAcceleration line: 1450 upvalues: tbl_upv_1 (copy, index: 1) ]] local v72 = getmetatable(a1) == tbl_upv_1 assert(v72, ("Cannot statically invoke method '%s' - It is an instance method. Call it on an instance of this class created via %s"):format("AddAcceleration", "ActiveCast.new(...)")) assert(a1.StateInfo.UpdateConnection ~= nil, "This ActiveCast has been terminated. It can no longer be used.") a1:SetAcceleration(a1:GetAcceleration() + a2) end function tbl_upv_1.AddPosition(a1, a2) --[[ name: AddPosition line: 1456 upvalues: tbl_upv_1 (copy, index: 1) ]] local v73 = getmetatable(a1) == tbl_upv_1 assert(v73, ("Cannot statically invoke method '%s' - It is an instance method. Call it on an instance of this class created via %s"):format("AddPosition", "ActiveCast.new(...)")) assert(a1.StateInfo.UpdateConnection ~= nil, "This ActiveCast has been terminated. It can no longer be used.") a1:SetPosition(a1:GetPosition() + a2) end function tbl_upv_1.DbgVisualizeSegment(a1, a2, a3) --[[ name: DbgVisualizeSegment line: 1462 ]] return DbgVisualizeSegment(a2, a3) end function tbl_upv_1.DbgVisualizeHit(a1, a2, a3) --[[ name: DbgVisualizeHit line: 1466 ]] return DbgVisualizeHit(a2, a3) end function tbl_upv_1.Pause(a1) --[[ name: Pause line: 1472 upvalues: tbl_upv_1 (copy, index: 1) ]] local v74 = getmetatable(a1) == tbl_upv_1 assert(v74, ("Cannot statically invoke method '%s' - It is an instance method. Call it on an instance of this class created via %s"):format("Pause", "ActiveCast.new(...)")) assert(a1.StateInfo.UpdateConnection ~= nil, "This ActiveCast has been terminated. It can no longer be used.") a1.StateInfo.Paused = true end function tbl_upv_1.Resume(a1) --[[ name: Resume line: 1478 upvalues: tbl_upv_1 (copy, index: 1) ]] local v75 = getmetatable(a1) == tbl_upv_1 assert(v75, ("Cannot statically invoke method '%s' - It is an instance method. Call it on an instance of this class created via %s"):format("Resume", "ActiveCast.new(...)")) assert(a1.StateInfo.UpdateConnection ~= nil, "This ActiveCast has been terminated. It can no longer be used.") a1.StateInfo.Paused = false end function tbl_upv_1.Terminate(a1, a2, a3) --[[ name: Terminate line: 1484 upvalues: tbl_upv_1 (copy, index: 1) ]] local v76 = getmetatable(a1) == tbl_upv_1 assert(v76, ("Cannot statically invoke method '%s' - It is an instance method. Call it on an instance of this class created via %s"):format("Terminate", "ActiveCast.new(...)")) assert(a1.StateInfo.UpdateConnection ~= nil, "This ActiveCast has been terminated. It can no longer be used.") local Trajectories_2 = a1.StateInfo.Trajectories Trajectories_2[#Trajectories_2].EndTime = a1.StateInfo.TotalRuntime if a1.StateInfo.UpdateConnection then a1.StateInfo.UpdateConnection:Disconnect() end a1.Caster.CastTerminating:FireSync(a1, a2, a3) if a1.StateInfo.UpdateConnection then a1.StateInfo.UpdateConnection = nil end a1.Caster = nil a1.StateInfo = nil a1.RayInfo = nil setmetatable(a1, nil) end return tbl_upv_1