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

How do I make something dissapear when a certain block touches it?

Asked by 5 years ago

I am making a rube goldberg machine and I want a ball to roll into something then it dissapears but when I add dissapearing on touch scripts they just dissapear before they get touched by the ball. Please help my dudes

0
ok, can you at least try at first, then post you attempt, if it doesn't work post what is erroring/ wrong with your script and we'll see if we can help, and I feel this is brought up a lot but, this isn't a request site, its not "scriptingrequesters" theking48989987 2147 — 5y
0
Scripting Helpers is NOT a request Site!!!! Enomphia 39 — 5y
0
Read the rules please C; greatneil80 2647 — 5y

2 answers

Log in to vote
3
Answered by 5 years ago
script.Parent.Touched:Connect(function(touch)
touch:Destroy()
end)
Ad
Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

If I understand you, you want a brick that destroys a ball.

Here is an easy code:

local DestroyingBrick = game.Workspace.DestroyingBrick --Our destroying brick that detroys balls
local NormalBall = game.Workspace.NormalBall --Our normal ball that gets destroyed

script.Parent.Touched:connect(function() --something touches the destroying brick
    Ball:Destroy() --Ball gets destroyed :D
end)

Answer this question