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

How do i make a part whitch will be deleted after a player touches it whit the right tool?

Asked by 3 years ago
Edited 3 years ago

I don't have any idea how do code this so i can't put some code here.I want make it so you can break down windows whit ur hands.

0
make sure this code is inside a part: local part=script.Parent part.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("gear name here")~=nil then part:Destroy() end end) Brycefitz2008 2 — 3y
0
Ok thank you marcusmitevaal -1 — 3y
0
no problem, I am a good scripter who just helps people in his free time :D Brycefitz2008 2 — 3y
0
Wait it doesn't seem to be working send it whit the answer and make it right cuz the long line of code won't help marcusmitevaal -1 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago
game.Workspace.Part.Touched:Connect(function(otherPart)
    if otherPart.Parent.Name == ' tool name here ' then
    script.Parent:Destroy()
    end
end)
0
Thanks for the help I may even give you admin in my game who knows! marcusmitevaal -1 — 3y
Ad

Answer this question