As I learnt recently that you cant explode terrain I have decided that I will need to actually destroy the terrain. I am making a DeathBeam and when the DeathBeam touches the terrain it lags the game alot due to I think the amount of checks being done. Here is my current script:

script.Parent.Activated:Connect(function()
	if script.Parent.Parent.Name ~= "Gooncreeper" then
		script.Parent:Destroy()
	elseif script.Parent.Parent.Parent.Name ~= "Gooncreeper" and script.Parent.Parent.Name == "Backpack" then
		script.Parent:Destroy()
	end
	ToolLocation = script.Parent
	script.Parent = game.Lighting
	ToolLocation:Destroy()
	game.Lighting.DEATHBEAM.Parent = game.Workspace
	Message = Instance.new("Message", game.Workspace)
	for i = 1, 10 do
		Message.Text = "World Destruction In: ".. 10 - i
		wait(1.5)
	end
	PartLength = 0
	Message:Destroy()
	repeat
		game.Workspace.DEATHBEAM.BEAM.Size = game.Workspace.DEATHBEAM.BEAM.Size + Vector3.new(5,0,0)
		PartLength = PartLength + 5
		game.Workspace.DEATHBEAM.BEAM.Position = game.Workspace.DEATHBEAM.BEAM.Position + Vector3.new(-2.5,-2.25,0)
		wait(0.01)
		PartsTouchingBeam = game.Workspace.DEATHBEAM.BEAM:GetTouchingParts()
		for i, v in pairs(PartsTouchingBeam) do
			if PartsTouchingBeam[i].Name ~= "Terrain" then
				PartsTouchingBeam[i]:Destroy()
			else
				--DESTROY TERRAIN HERE
			end
		end
	until PartLength == 10000
end)

1 comment

0

Do not duplicate your question. Delete this and update your old one, that is one reason why there is an edit button when you ask questions.