local p = script.Parent
local lava = game.Workspace.Base
function onTouched(part)
local human = part.Parent:FindFirstChild("Humanoid")
if human ~= nil then
human.Health = human.Health - 1
p.Anchored = false
end
end
lava.Touched:Connect(function(part)
local partical = Instance.new("Part")
if part.Touched:FindFirstChild("Brick") then
p.BrickColor = BrickColor.new("Bright Red")
partical:Clone()
partical.Anchored = false
end
end)
script.Parent.Touched:Connect(onTouched)
✓ ANSWER ACCEPTED
FindFirstChild is not a valid member of RBXScriptSignal?
1 answer
✓ Accepted answer
if part.Touched:FindFirstChild("Brick") then
.Touched is an event of a object, if you have a object named .Touched your probably going to want to rename it to something else. Otherwise if your just trying to find the object that was touched, the touched event returns a parameter that specifies the touched part. To fix your issue you would want to end up doing this.
if part:FindFirstChild("Brick") then
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Thank you, this does work but for some reason it wont make the partical.
Your going to have to parent the particle.