Volcanic Eruption

Basically I have this volcano that I want to erupt. I want to shoot about 4-5 rocks out of it and I know it has something to do with raycast but I honestly don’t know how to go about doing it. Its been 6 months since I touched roblox studio so any kind of help would be helpful.

Also how would I tell when the rocks hit the ground.
(I tried looking for topics on this but couldn’t find anything, this post is basically my alternative.)

2 Likes

You could do this by Cloning an Part in serverStorage, and add to the part A flame Trail, then add a BodyVelocity to make the Falling effect, like sparks

local OriginPart = script.Parent

local Debris = game:GetService("Debris");

		for partAdd = 1, math.random(6, 15) do
			local Effect = game.ServerStorage.BloodPart:Clone()
			Effect.Parent = workspace
			Effect.CFrame = Character:WaitForChild("HumanoidRootPart").CFrame * CFrame.Angles(math.rad(math.random(-180, 180)), math.rad(math.random(-180, 180)), math.rad(math.random(-180, 180)))

			Effect.Splatter:Play()

			local EffectVelocity = Instance.new("BodyVelocity", Effect)
			EffectVelocity.MaxForce = Vector3.new(1, 1, 1) * 1000000;
			EffectVelocity.Velocity = Vector3.new(1, 1, 1) * Effect.CFrame.LookVector * math.random(20, 40)

			Debris:AddItem(EffectVelocity, 0.2)
			Debris:AddItem(Effect, 3)
		end
	end
	
end)

4 Likes

Thank you sir, It works perfectly

1 Like