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

How do I choose a specific part to have deleted on touch?

Asked by 4 years ago

For example when I am Using a on touch script like when I touch a part it deletes a specific part. Like if there is a jail cell and when I step On a a block it deletes the three bars how do I choose those three bars to be deleted in that script

0
You can group those bars into a model and use a for loop to either destroy each one or parent it to a place like ReplicatedStorage ilostmyaccount678 0 — 4y
0
not a request site, show some code before asking Brandon1881 721 — 4y
0
I have Not tried this before so I dont Have a code and I am New to scripting sorry Scallywagpugzy 0 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

it will be something like

bar1 = location
bar2 = location
bar3 = location
touched = script.Parent(or location)

touched.OnTouched:connect(function()
    bar1:Destroy()
    bar2:Destroy()
    bar3:Destroy()
end)
Ad

Answer this question