Thank you for posting your code, currently as I read your question, your trying to figure out how to delete/remove 3 parts.
This will be kinda like a tutorial.
First, you will need 3 parts that you want to delete. As an example let's just name them
"Part1", "Part2", and "Part3". Now you will need to make sure all these parts have their settings correct.
- Make sure the part's CanCollide and Anchored settings are both true
Now, you will need another part, Name it "Button". Right Click on Button and insert a ClickDetector.
Now add a Script to the ClickDetector so that the Button is the part, the ClickDetector is inside of the Part and the script is inside of the ClickDetector.
Now open up the script and delete "Print("Hello World")".
starter with variables, I won't be explaining variables but in other words, variables are to help you define objects and makes scripting easier.
Let's define the ClickDetector, Part1, Part2 and Part3.
This is how it should look like:
local Clicker = script.Parent
local Part1 = game.Workspace:WaitForChild("Part1")
local Part2 = game.Workspace:WaitForChild("Part2")
local Part3 = game.Workspace:WaitForChild("Part3")
Now we add the Click Event
This is how it should look like:
local Clicker = script.Parent
local Part1 = game.Workspace:WaitForChild("Part1")
local Part2 = game.Workspace:WaitForChild("Part2")
local Part3 = game.Workspace:WaitForChild("Part3")
Clicker.MouseClick:connect(function()
end)
Now we want to make it so that you destroy the 3 parts
so lastly this is how everything should look like:
local Clicker = script.Parent
local Part1 = game.Workspace:WaitForChild("Part1")
local Part2 = game.Workspace:WaitForChild("Part2")
local Part3 = game.Workspace:WaitForChild("Part3")
Clicker.MouseClick:connect(function()
Part1:Destroy()
Part2:Destroy()
Part3:Destroy()
end)
Now go try clicking the part named "Button" and see if it works. Please accept answer and upvote if helped and worked.
4 comments
I might need to use WaitForChild but I am not experienced with WaitForChild
It would be helpful if you showed the code
Show code
Im asking for one line of code ;-;