Is there way to make lighting bolt?

Hello there

I’m currently wondering how is working lighting bolt system Like in game Creeper Chaos made by RVVZ
And another games that have lighting bolt system, I did not know how script is making or spawning these lighting bolts I think maybe game like Creeper Chaos is using OOP style but there is again question how ? , I tried searching forums or any youtube videos but I did not found anything , So if anyone have experience with doing lighting system, Please help me on this topic,
Thank for any help or comment you written on this post! :wave:

3 Likes

To make a lightning bolt, you probably need a specialized part that is cloned from ServerStorage and strikes at a random coordinate position. Haven’t made one myself so I don’t know, but this is just my theory.

Is that what you are searching for?

EDIT:
I did a script but it just create part at once and it is changing,
But I dont know how to make it to continue to the part B
My script:

local PathService = game:GetService("PathfindingService")
local RunService = game:GetService("RunService")
local PartA  = workspace.A
local PartB = workspace.B
local CreatedParts = {}
local LastPos = nil
while wait(2) do
	local DistanceInMagnitude = (PartA.Position - PartB.Position).Magnitude
	local Path = PathService:CreatePath()
	Path:ComputeAsync(PartA.Position, PartB.Position)
	local WayPoints = Path:GetWaypoints()
	for _,point in pairs(WayPoints) do
		if CreatedParts ~= {} then
			for _,s in pairs(CreatedParts) do 
				s:Destroy()
			end
		end
		local PermanentPos = point.Position
		local ModdifiedPos = PermanentPos + Vector3.new(math.random(-1,1),math.random(-1,1),math.random(-1,1))
		if LastPos == nil then
			local Part = Instance.new("Part",workspace)
			Part.CFrame = CFrame.new(ModdifiedPos,PartA.Position)
			LastPos = Part.Position
			table.insert(CreatedParts,Part)
		end
		local Part = Instance.new("Part",workspace)
		Part.CFrame = CFrame.new(ModdifiedPos,LastPos)
		LastPos = Part.Position
		table.insert(CreatedParts,Part)
	end
end
1 Like

That’s really complex for something I did in a few seconds:

while true do
	
	local bolt = game:GetService("ServerStorage").Lightning:Clone()
	bolt.Parent = game:GetService("Workspace")
	bolt.Position = Vector3.new(math.random(-400, 400), 49, math.random(-400, 400))
	print(bolt.Position)
	wait(1)
	bolt:Destroy()
end
1 Like

How this can help me ?

[spoiler]/spoiler]

You… want to know how to make lightning, right?

Do you have discord ? So I can contact you on discord it will be better than on forum

No I don’t have discord but we can take it to DMs.