This glass breaking script only breaks when any object touches it, because it is onTouch. How ever how would i make it were a specific object touches it that is located in the workspace, like the baseplate?
function x(hit) script.Parent.Anchored = false script.Parent.GlassSound:Play() script:remove() end script.Parent.Touched:connect(x)
You can use .Name in an if statement inside of the ("hit")
function x(hit) if hit.Name == "Baseplate" then script.Parent.Anchored = false script.Parent.GlassSound:Play() script:remove() end end script.Parent.Touched:connect(x)
This would make it so that if the name of the part that is touching the glass is "Baseplate", the glass will break. You can also do methods for players using a statement to figure out if they have a humanoid inside them,
function x(hit) if hit.Parent:FindFirstChild("Humanoid") then script.Parent.Anchored = false script.Parent.GlassSound:Play() script:remove() end end script.Parent.Touched:connect(x)
Hope this helps!