Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is it possible to trigger an event by having two parts touch?

Asked by 8 years ago

I am trying to make a part that grows and breaks everyone and everything it touches, but Touched seems to only work for people. Here's what I've tried so far, with no luck:

script.Parent.Touched:connect(function(otherpart)
    if otherpart.Name ~= "BasePlate" then
        otherpart:BreakJoints()
        otherpart.Material = "CorrodedMetal"
        otherpart.BrickColor = BrickColor.new(26)
        local o = math.random(1, 20)
        if o == 5 then
            local b = Instance.new("Fire")
            b.Parent = otherpart
        end
    end
end)
0
Baseplate is spelled "Baseplate" in roblox not "BasePlate". Capitalization matters. Can you give us more details? What was the error? Is this a local script or regular? User#11440 120 — 8y
0
@wfv, that is a name, which can be named by anyone. Yes Baseplate is commonly spelled the way you said it, but anyone can name it whatever to not be common. scottmike0 40 — 8y
0
It was only detecting players touching it and not parts touching it and it was a regular script. strongestarmy10 5 — 8y

Answer this question