This is the script i used to make the part, Meteor, fall and when it hits other parts it makes those parts get destroyed from the game. Though it doesn't work and i can't figure out why not.
local meteor = Instance.new('Part', game.Workspace) meteor.Name = 'Meteor' meteor.Anchored = false meteor.Touched:connect(function(boom) if boom.Name ~= 'Baseplate' and boom ~= nil then local boom = Instance.new('Explosion', game.Workspace) boom.Position = boom.Position boom:Destroy() end end)
On line 6 of your script, you'll notice you create a variable named boom. This variable points to what the part, "meteor", touched. On line 8 of your script however, you create another variable named boom again.
You don't have to delete an explosion, it does it for you. If you want to delete the part the meteor touched, rename the variable boom, the first boom, to something else.
Example,
local meteor = Instance.new('Part', game.Workspace) meteor.Name = 'Meteor' meteor.Anchored = false meteor.Touched:connect(function(part) if part.Name ~= 'Baseplate' then local boom = Instance.new('Explosion', game.Workspace) boom.Position = part.Position part:Destroy() end end)
Good Luck!