Hello, I am once again trying to solve my problem with rocket jumping; however, I still cant figure it out.
local Explosion = Instance.new("Explosion")
Explosion.Name = "NoShake"
Explosion.BlastRadius = Settings.BlastRadius
Explosion.BlastPressure = 0
Explosion.ExplosionType = Enum.ExplosionType.NoCraters
Explosion.Position = hitPoint
Explosion.Visible = false
Explosion.Parent = workspace
local HitHumanoids = {}
Explosion.Hit:Connect(function(HitPart, HitDist)
if HitPart then
local Target = HitPart:FindFirstAncestorOfClass("Model")
local TargetHumanoid = Target and Target:FindFirstChildOfClass("Humanoid")
local TargetTorso = Target and (Target:FindFirstChild("HumanoidRootPart") or Target:FindFirstChild("Head"))
if TargetHumanoid and TargetHumanoid.Health > 0 and TargetTorso then
if not HitHumanoids[TargetHumanoid] then
HitHumanoids[TargetHumanoid] = true
local DamageThroughWall = true
if TargetHumanoid.Parent.Name == script.Parent.Parent.Name then
local Multipler = 2
local VelocityMod = (TargetTorso.Position - Explosion.Position).Unit * 100
local AirVelocity = TargetTorso.Velocity - Vector3.new(0, TargetTorso.Velocity.Y, 0) + Vector3.new(VelocityMod.X, 0, VelocityMod.Z)
local TorsoFly = Instance.new("BodyVelocity")
TorsoFly.MaxForce = Vector3.new(math.huge, 0, math.huge)
TorsoFly.Velocity = AirVelocity
TorsoFly.Parent = TargetTorso
TargetTorso.Velocity = TargetTorso.Velocity + Vector3.new(0, VelocityMod.Y * Multipler, 0)
print(TargetTorso.Velocity)
Debris:AddItem(TorsoFly, 0.25)
end
end
end
end
end)
The script above that I’m using is from another script that has the same exact logic except in a different script.
(the script in question (just the logic part since everything else is the exact same)
local Multipler = 2
local VelocityMod = (TargetTorso.Position - Explosion.Position).Unit * 100
local AirVelocity = TargetTorso.Velocity - Vector3.new(0, TargetTorso.Velocity.Y, 0) + Vector3.new(VelocityMod.X, 0, VelocityMod.Z)
local TorsoFly = Instance.new("BodyVelocity")
TorsoFly.MaxForce = Vector3.new(math.huge, 0, math.huge)
TorsoFly.Velocity = AirVelocity
TorsoFly.Parent = TargetTorso
TargetTorso.Velocity = TargetTorso.Velocity + Vector3.new(0, VelocityMod.Y * Multipler, 0)
print(TargetTorso.Velocity)
Debris:AddItem(TorsoFly, 0.25)
However, in this case it works?
When printing Multiplier, and the knockpower (100), it all returns the same
and when printing out the targettorsos velocity after it returns with this
However with the first script, when printing out the targettorso velocity, it shows up nearly the same for the Y, the only problem is that the player NEVER gets launched into the air.
Even when porting the first script into any of game, it never launches the player and its so faulty.
But the second script ALWAYS works, just not the first script.
(first scripts rocket launcher)
(second scripts rocket launcher)
please save me from a headache I’ve been on this for the past day and today aswell.