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

How do I make it so when my duplicated tool handle touches a brick, something happens?

Asked by 5 years ago

I have it so when I click on a tool, it duplicates the tool, and it drops right in front of me. I want it so when the duplicated tool handle touches the brick, something happens to it. This is the code that I have so far and does not seem to work.

script.Parent.Touched:Connect(function(hit)
    if hit:IsA("UnionOperation") then
        if hit.Name == "Handle" then
            script.Parent:Destroy()
        end
    end
end)

1 answer

Log in to vote
0
Answered by 5 years ago

The issue that I was having is solved, and the reason their was an issue is because I was using a local script to clone the tool, which only made it client side, and the server did not detect it being created. I also had to use a remote event to fire the server.

Ad

Answer this question