How to get rid of bomb damage

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? I want to make it so that a bomb wont kill you

  2. What is the issue? I cannot find the damage thing

  3. What solutions have you tried so far? Youtube, editing script, Devforum

local bombScript = script.Parent.Bomb
local Tool = script.Parent
local Bomb = Tool.Handle

function plant()
	local bomb2 = Instance.new("Part")
   
	local vCharacter = Tool.Parent
	local vPlayer = game.Players:playerFromCharacter(vCharacter)

	local spawnPos = Bomb.Position

	bomb2.Position = Vector3.new(spawnPos.x, spawnPos.y+3, spawnPos.z)
	bomb2.Size = Vector3.new(2,2,2)
	
	bomb2.BrickColor = BrickColor.new(21)
	bomb2.Shape = 0
	bomb2.BottomSurface = 0
	bomb2.TopSurface = 0
	bomb2.Reflectance = 1
	bomb2.Name = "TimeBomb"
	bomb2.Locked = true

	local creator_tag = Instance.new("ObjectValue")
	creator_tag.Value = vPlayer
	creator_tag.Name = "creator"
	creator_tag.Parent = bomb2

	bomb2.Parent = game.Workspace
	local new_script = bombScript:clone()
	new_script.Disabled = false
	new_script.Parent = bomb2
end


Tool.Enabled = true
function onActivated()

	if not Tool.Enabled then
		return
	end

	Tool.Enabled = false

	local character = Tool.Parent;
	local humanoid = character.Humanoid
	if humanoid == nil then
		print("Humanoid not found")
		return 
	end

	local targetPos = humanoid.TargetPoint
	Bomb.Transparency = 1.0

	plant()

	wait(6)
	Bomb.Transparency = 0.0

	Tool.Enabled = true
end

function onUnequipped()
end


Tool.Activated:connect(onActivated)
Tool.Unequipped:connect(onUnequipped)
local updateInterval = .4

local currentColor = 1
local colors = {26, 21} 

local ticksound = Instance.new("Sound")
ticksound.SoundId = "rbxasset://sounds\\clickfast.wav"
ticksound.Parent = script.Parent

function update()
	updateInterval = updateInterval * .9
	script.Parent.BrickColor = BrickColor.new(colors[currentColor])
	currentColor = currentColor + 1
	if (currentColor > 2) then currentColor = 1 end
end


function blowUp()
	local sound = Instance.new("Sound")
		sound.SoundId = "rbxasset://sounds\\Rocket shot.wav"
		sound.Parent = script.Parent
		sound.Volume = 1
		sound:play()
	explosion = Instance.new("Explosion")
	explosion.BlastRadius = 12
	explosion.BlastPressure = 500000 -- these are really wussy units

	-- find instigator tag
	local creator = script.Parent:findFirstChild("creator")
	if creator ~= nil then
		explosion.Hit:connect(function(part, distance)  onPlayerBlownUp(part, distance, creator) end)
	end

	explosion.Position = script.Parent.Position
	explosion.Parent = game.Workspace
	script.Parent.Transparency = 1
end

function onPlayerBlownUp(part, distance, creator)
	if part.Name == "Head" then
		local humanoid = part.Parent.Humanoid
		tagHumanoid(humanoid, creator)
	end
end

function tagHumanoid(humanoid, creator)
	-- tag does not need to expire iff all explosions lethal	
	if creator ~= nil then
		local new_tag = creator:clone()
		new_tag.Parent = humanoid
	end
end

function untagHumanoid(humanoid)
	if humanoid ~= nil then
		local tag = humanoid:findFirstChild("creator")
		if tag ~= nil then
			tag.Parent = nil
		end
	end
end

while updateInterval > .1 do
	wait(updateInterval)
	update()	
	ticksound:play()	
end

blowUp()
wait(2)
script.Parent:remove()

if there is no way to get rid of the damage, oh well
those aere all the scripts in the bomb

The explosion is what is causing players to die. You need to set the DestroyJointRadiusPercent to 0 (In your second script).
So do this on line 27 in your second script:

explosion.DestroyJointRadiusPercent = 0

i got
Workspace.TimeBomb.Bomb:27: attempt to index nil with ‘DestroyJointRadiusPercent’

Which script have you done placed that line of code?

The second script I put in this topic, the bottom one

Oh I forgot to lowercase the E in explosion.
Replace that line of code with this:

explosion.DestroyJointRadiusPercent = 0

Thx man, u really helped me with my game

1 Like

You are welcome. Happy to help! Please, next time, do your proper research and analysis before posting on the Developer Forum. If you have done enough research/analysis, I’m sure you would have found your issue and fixed it. I have found many topics related to what you are trying to do.

1 Like