[Effect] v1.1 Lightning Beams: Seamless, smooth and procedurally animated with beam-like properties

sorry but how do i make it so every one can see cus when i create it in the server side it can only be seen in the server i dont get it

Edit: it works now MoonlightAnim is right u just go inside the module and change the parent toa folder inside workspace :smiley: btw nice module

2 Likes

Graphical effects like this should be run from the client, not from the server. You can set up the module on the client and then have the server broadcast wherever effects need to happen, then pick that event up client-side and invoke the module with that.

25 Likes

The spark module doesn’t seem to be working, on the first test place with 1 beam. I’ve tried playing around with the properties, to no avail.

1 Like

Are you talking about the explosion?

1 Like

No, I’m talking about the module titled “LightningSparks.”

1 Like

This is phenomenal. I’ve seen a lot of fancy creations in my days here, and most of the time I get a “Hey that’s cool”, or for the good stuff I go “Damn that’s awesome”. This is one of the very few that has made me flat out yell from the visual style.

Outstanding work. I plan to adapt this for my own games, likely mixing in PartCache to improve performance of the part-based lightning (at least, until you finish the release of V2, and assuming it’s even necessary - I’ve yet to view the code). The fact that you have open sourced this module is something I greatly respect, and I look forward to seeing your future work.

8 Likes

This module is great, I’ve been using it in a few games here and there and it has come in extremely handy, thanks.

2 Likes

I was thinking the same lol, I’ve never seen this before

4 Likes

Really love this! Just looking for an easier to use version! My head hurts from the math… ;(

1 Like

why i have this problem?
look at the difference game,studio

Game:Screen capture - d535965c6ed9040619c8650f3784db82 - Gyazo

Studio:Screen capture - 3283c9a29f6644f0087d5c59a6283ae1 - Gyazo

5 Likes

Looking inside the “LightningBolt” Module, There is a small tip saying:

--Small tip: You don't need to use actual Roblox Attachments below. You can also create "fake" ones as follows:
--[[
local A1, A2 = {}, {}
A1.WorldPosition, A1.WorldAxis = chosenPos1, chosenAxis1
A2.WorldPosition, A2.WorldAxis = chosenPos2, chosenAxis2
local NewBolt = LightningBolt.new(A1, A2, 40)
--]]

In my opinion, this isn’t properly explained, because when i tried this out, it came as a error saying:
“ReplicatedStorage.LightningBolt:88: attempt to perform arithmetic (mul) on nil and number”
This is my code:

local LightningBolt = require(game.ReplicatedStorage.LightningBolt)
local LightningSparks = require(game.ReplicatedStorage.LightningBolt.LightningSparks)
local LightningExplosion = require(game.ReplicatedStorage.LightningBolt.LightningExplosion)
local A0,A1 = {},{}
A0.WorldPosition,A0.WorldAxis = Vector3.new(0,0,0),Vector3.new(1,0,0)
A0.WorldPosition,A0.WorldAxis = Vector3.new(0,50,0),Vector3.new(1,0,0)


local NewBolt = LightningBolt.new(A0, A1, 40)
NewBolt.CurveSize0, NewBolt.CurveSize1 = 10, 15
NewBolt.PulseSpeed = 2
NewBolt.PulseLength = 0.5
NewBolt.FadeLength = 0.25
NewBolt.MaxRadius = 1
NewBolt.Color = Color3.new(0.745098, 0.980392, 1)
local NewSparks = LightningSparks.new(NewBolt)
2 Likes

I Fixed my own problem, all i needed to do is:

local A0 = {
	WorldPosition = Vector3.new(0,0,0),
	WorldAxis = Vector3.new(0,0,0)
}
local A1 = {
	WorldPosition = Vector3.new(0,50,0),
	WorldAxis = Vector3.new(0,0,0)
}

local NewBolt = LightningBolt.new(A0, A1, 40)
NewBolt.CurveSize0, NewBolt.CurveSize1 = 10, 15
NewBolt.PulseSpeed = 2
NewBolt.PulseLength = 0.5
NewBolt.FadeLength = 0.25
NewBolt.MaxRadius = 1
NewBolt.Color = Color3.new(0.745098, 0.980392, 1)

For some reason the way this was explained was wrong and will cause a error???
I would recommend putting the “WorldAxis” and “WorldPosition” inside the table

3 Likes

I believe you made a typo here, you forgot to edit the second table A1 and instead copied it over to A0 instead. Just a small mistake,. It should be:

A0.WorldPosition,A0.WorldAxis = Vector3.new(0,0,0),Vector3.new(1,0,0)
--A1 here
A1.WorldPosition,A1.WorldAxis = Vector3.new(0,50,0),Vector3.new(1,0,0)
3 Likes

It seems that when ran on the server, the lightning doesnt show on the client… so using a ServerScript for creation wont work, this can only be achieved on the client if ran on a LocalScript by Client Replication, do you think there should be a function that automatically client replicates when ran on a server script?

You shouldn’t do it like that anyway as it unnecessarily uses server resources + the effect would only run as fast as the rate at which you receive data from the server and so will appear ‘jumpy’ at times.

I can’t assume what frameworks/modules others might use for replication. It would potentially create an inconsistency within their framework. Also, I don’t want to force how users want to set up their replication → For example, they might want to use string.pack to send over replication data or might not want to send any extra data at all as they instead want some electricity “door” (with pre-defined Lightning properties) to just open/close.

The ideal setup for replication is mentioned in the solution of this post.

4 Likes

titan shifting is perfect now THANKS!

2 Likes

I’m using this module for a lightning skill, and I need the lightning to be on a specific part, and that part will be moving, and as you know this lightning needs time to “update.” Is there any way I could have the lightning “locked” to this one part?

1 Like

The module should be able to do this pretty easily.
You can use Roblox attachments as inputs for LightningBolt.new.
The attachment(s) should be parented to your specific Part.

Not really sure what you meant here but if you’re still unable to achieve what you want, send a repo file

1 Like

I’m already doing this.

What I meant by “update” was for example the part that the attachment is in moves the lightning takes a few seconds to come to the new position. If you still dont understand i’ll send a video of what I mean.

1 Like

how can i make my lightning effects brighter? I made some effects with it but its not brighter

1 Like