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.