#I'm trying to make parts get deleted when they come in contact with another part

5 messages · Page 1 of 1 (latest)

honest violet
#

I'm very new to Lua, I started yesterday, and right now I'm trying to make use of isntances. I got an instance to create a new part, now what I'm stuck with is getting that part to get deleted if it comes in contact with another part.

--This is the instance that creates a new part
local blockmaker = Instance.new("Part", game.Workspace)


blockmaker.Anchored = false
blockmaker.Position = Vector3.new(50,50,50)
blockmaker.Material = "Neon"
blockmaker.BrickColor = BrickColor.new("Really red")
--this is not my orignal script for what i tried, but I tried this and its essentially a simplified version of what im trying to do. 
game.Workspace.blockdeleter.Touched:Connect(function(hit)
    hit.Parent:Destroy()
end)

My goal is to make it so that when the red block spawns in above the white one, the red block gets destroyed once it comes in contact with the white one.

#

Also I didn't know exactly which tag to use for this post im hoping its the right one

dense fulcrum
#

See what's being returned for hit.Parent

#

Like do print(hit.Parent)