Okay so everything below is working fine the part is being spawned, and the message is popping up. But the one thing that isn't working is when the part touches me it isn't killing me. I'm assuming it has something to do with the fact that the first thing it touches is the baseplate but other than that I'm not sure. And if you know how I can make the event occur only once when touching the part instead of numerous times instantaneously that'd be nice, thanks.------------
function Cough(Part)
local fries = Instance.new('Message')
fries.Parent = game.Workspace
fries.Text = "Hello I will now explode"
wait(3)
fries:Destroy()
local explosion = Instance.new('Part', game.Workspace)
Part = explosion
Part.Anchored = true
Part.Shape = 'Ball'
Part.Transparency = 0.1
Part.TopSurface = "Smooth"
Part.BottomSurface = "Smooth"
Part.CanCollide = false
while true do
Part.Size = Part.Size + Vector3.new(1,1,1)
wait()
end
end
local hum = game.Workspace.Brick.Script.Parent:FindFirstChild("Humanoid")
function death(hum)
if hum ~=nil then
hum.Health = 0
end
end
script.Parent.Touched:connect(Cough)
if
game.Workspace.Cough:connected() then
death()
end

1 comment
You can just merge your 'death' function into 'Cough', like right after resizing the Part.