Сould you please describe the operation of this script?

script.Parent.Humanoid.Died:connect(function()
local caboom = Instance.new(“Explosion”, script.Parent)
caboom.Position = script.Parent.HumanoidRootPart.position
caboom.ExplosionType = Enum.ExplosionType.NoCraters
caboom.DestroyJointRadiusPercent = 0
end)

please help me to describe this!

1 Like

To desribe this code you can add commnets to the script like this:

print(1 + 1) -- it will print 2
print(2 * 2) -- it will print 4
--[[
This is
a comment
block
--]]

maybe I didn’t formulate the question correctly. I’m building my game and I don’t understand how this script works. I just took it from the internet. I would like to get some help from you to figure out how it works

Now I get that! I apologize. I can see that someone is explaining that to you and I need to get some rest so I wish you a good day.

2 Likes
script.Parent.Humanoid.Died:connect(function()  --this function connects each time the script.Parent dies. This means the script must be loaded in the player.
    local caboom = Instance.new(“Explosion”, script.Parent)  -- creates an explosion instance parented to the player (Why did they use caboom instead of kaboom? lol)
    caboom.Position = script.Parent.HumanoidRootPart.position --makes the explosion at the HumanoidRootPart of the player.
    caboom.ExplosionType = Enum.ExplosionType.NoCraters  -- makes it so it won't destroy Terrain
    caboom.DestroyJointRadiusPercent = 0  -- ensures the explosion doesn't break the joints of other players as well.
end)
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.