Im not sure how the players health, and if they have the tool out
To check when they are equipping a tool, simply check if their character has a Tool
as a child.
When they equip a tool, it gets into their character, and when they unequip, it goes back to Backpack
.
1 Like
Check when the player dies and if the tool is inside the Character model (if the tool is in the character model, the player is holding the tool) then use Instance.new(“Explosion”) to make the explosion on the Character.
Helpful Sources:
https://developer.roblox.com/en-us/resources/bipi-2021-summer/tier-1/making-an-explosion
1 Like
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
local Humanoid = Character:WaitForChild("Humanoid")
Humanoid.Died:Connect(function()
if Character:FindFirstChildWhichIsA("BackpackItem") then
local Root = Humanoid.RootPart
local Explosion = Instance.new("Explosion")
Explosion.Parent = Root
end
end)
end)
end)
1 Like