Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

FindFirstChild is not a valid member of RBXScriptSignal?

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)

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

2 comments

0

Thank you, this does work but for some reason it wont make the partical.

0

Your going to have to parent the particle.

This discussion is preserved as it was. New answers, comments, and votes are closed.