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

How to make my fireball disappear if it hits a part named "Wall"?

Im making a fireball and I don't why this code isn't working

local fireball = script.Parent

fireball.Touched:connect(function(hit)
	if hit.Parent.Name == "Wall" then
		script.Parent:remove()
	end
end)

1 answer

✓ Accepted answer

I haven't coded in Lua in quite some time, but something like this might work

script.Parent.Touched:connect(function(hit)
    if hit.Name == "Wall" then
        script.Parent:remove()
    elseif hit.Parent.Name == "Wall" then
        script.Parent:remove()
    end
end)

1 comment

0

thanks sm

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