Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

3 comments

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

0

not a request site, show some code before asking

0

I have Not tried this before so I dont Have a code and I am New to scripting sorry

1 answer

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.