[Ver 1.0.1] | Crater Generator

I hope this one is not useless just like the attach to camera module… also this was a pain to make

What is this module ?

This module lets you generate craters easily that looks like ones in those vfx things (idk if it’s really stealing atp)

How does it works ?

First, get the module here

Then require this module

local module = require(game.ReplicatedStorage.CraterModule)

To create a crater do this :

local newCrater = module.new(rad, numberOfTimes, Size, maxParts, center, sizeIncrement, Material:Enum.Material, Color)
--rad : The start radius of the crater
--numberOfTimes : Number of layer the crater have
--Size : The size of the block
--maxParts : Maximum parts of one layer
--center : The center of the module
--sizeIncrement : How many studs the radius of the next crater is bigger than the previous one
--Material and Color : pretty self explanatory tbh

Then to make it appear just do this :

newCrater:SpawnCrater(TTime, lifeTime, EaseInStyle, EaseInDirection, EaseOutStyle, EaseOutDirection)
--TTime : Tweens the part's position for how many seconds
--Lifetime : How many seconds will it last before getting tweened back
--EaseInStyle, EaseInDirection, EaseOutStyle, EaseOutDirection : Self explanatory

More info

Updates
+ Little fixes
- Nothing else

Planned :
Crater Parts materials and colors syncs with the instance it touches
Higher blocks support

I am not really that good of a scripter so it may be a little bit buggy and i’m also just training
Tell me what is wrong with the script and i’ll try to fix it

How is the module ?
  • Very good
  • Nice
  • Can be improved
  • Ehh
  • No, just no

0 voters

5 Likes

wait is Deprecated, use task.wait instead

function CraterGenerator:SpawnCrater(TTime, lifeTime, EaseInStyle, EaseInDirection, EaseOutStyle, EaseOutDirection)
	
	if not TTime or not lifeTime or not EaseInStyle or not EaseInDirection or not EaseOutStyle or not EaseOutDirection then
		error("Error in CraterGenerator:SpawnCrater() : Some empty parameters are required.")
	end
		
	local delayTime = 0
	
	for _, v in self.Object:GetChildren() do
		for i, part in v:GetChildren() do
			Tween(part, TweenInfo.new(TTime, EaseInStyle, EaseInDirection), {Position = part.Position + Vector3.new(0, 20, 0)})
			Debris:AddItem(part, (((TTime * 3) * #self.Object:GetChildren()) + lifeTime))
		end
		wait(delayTime)
		Debris:AddItem(v, (((TTime * 3) * #self.Object:GetChildren()) + lifeTime))
	end
	wait(lifeTime)
	for _, v in self.Object:GetChildren() do
		for i, part in v:GetChildren() do
			Tween(part, TweenInfo.new(TTime, EaseOutStyle, EaseOutDirection), {Position = part.Position - Vector3.new(0, 20, 0)})
		end
		wait(delayTime)
	end
	wait(TTime)
	self.Object:Destroy()
end

Just updated it so it uses task.wait() instead of wait()

this module is server sided or only client side?

since it only creates parts, im guessing both

yeah you can do server and client