You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
Have it to where the blastpressure flings the Zombies away, and not fling the player away -
What is the issue? Include screenshots / videos if possible!
The player will get flung if they shoot at the ground or near a zombie -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
tried bodyvelocity instead but the results were janky and underwhelming.
Heres the section of the code handling the explosives
if Settings.ExplosiveAmmo then
local explo = Instance.new("Explosion", workspace)
explo.Visible = true
explo.BlastRadius = Settings.ExplosionRadius
explo.BlastPressure = Settings.BlastPressure
explo.DestroyJointRadiusPercent = 0
explo.ExplosionType = Enum.ExplosionType.NoCraters
explo.Position = Position
game.Debris:AddItem(explo, 2)
explo.Hit:Connect(function(hitpart)
if hitpart.Name == "Head" and hitpart.Parent:FindFirstChild("Humanoid") then
local cChr = hitpart.Parent
local cPlr = game.Players:GetPlayerFromCharacter(cChr)
local dist = (cChr.HumanoidRootPart.Position - Position).Magnitude
local MaxZone = Settings.ExplosionRadius
local MinZone = MaxZone / 3
local dmg = Settings.ExplosiveDamage
if cChr.Name == "Vertition's Soul" then
--print(cChr)
else
if not cPlr or cPlr == Player or Settings.AllowTK or cPlr.Neutral or gameRules.Teams[cPlr.Team.Name] ~= gameRules.Teams[Player.Team.Name] then
local skp_t = Instance.new("ObjectValue")
skp_t.Name = "creator"
skp_t.Value = Player
skp_t.Parent= cChr.Humanoid
game.Debris:AddItem(skp_t, 1)
if dist < Settings.ExplosionRadius / 3 then
if cChr.Name == "Zombie" then
cChr.Humanoid.Health = cChr.Humanoid.Health - dmg
print "too close"
else
print "Player"
end
end
end
end
end
end)
I also tried adding after print “player” setting the blast pressure to 0 but this didnt help as some of the guns blast pressure would effect the player from far away. Is it possible to have the blast pressure only fling/effect certain humanoids or am i going to have to approach this differently?