Lightning Module

Hello this is my first post of a module so it wont be as great as the other lightning modules out there
i made mine simple so you can add on to it if u feel the need to

In this module you can use ether a part or an attachment for the points

The Features of The Modules Are:

  • Shape - you can change it to a cylinder or a cube shape
  • Color - you can use Color3 or ColorSequence for the color
  • ColorOffSet - this is how fast you want the color to travel through the lightning
  • ColorJuggle - it randomize the color that you assigned (idk how to explain this just see for your self)
  • Focus - since you can use a part u can ether focus it in the center of the part or spread it within the part
  • Size - well its pretty self explanatory
  • Segments - how many parts you want to use per lightning strike
  • OffSet - its the zigzag effect on the lightning
  • FadeEffect - idk how to explain this
  • AnimationSpeed - basically how long it will take for the lightning to disappear
  • FadeMovement - idk how to explain this one

Here’s a little demonstration on what it can do:
(the values will not be included i just used the values so its easier to showcase)

https://www.roblox.com/library/8782652565/LightningModule

local Strike = require(module.path)

Strike.new(
	"cylinder",			--Block Usage (can be set to cylinder or cube) 
	ColorSequence.new{
		ColorSequenceKeypoint.new(0, Color3.fromRGB(255,50,50)),
		ColorSequenceKeypoint.new(1, Color3.fromRGB(0,255,255)),
	},					--BlockColor (lighting color)
	3,					--ColorOffset Howfast u want the color to travel through the lightning
	false,				--ColorJuggle turn on if u want to juggle the colors of the color squence
	script.Parent,		--Start Point
	workspace.Part2,	--End Point
	false,				--Focused or Spread (will spread to the part depending on what u set it to)
	math.random(1,2),	--Size (lightning size)
	15,					--Main Segments (basically how many segments u want the lighting to have going above 600 can lag the game)
	2.5,				--OffSet (set to higher number to make more zigzag effect)
	nil,				--Fade effect (set to nil if u want the lightning to strike imidielty)
	1,					--Aniamtion Speed (basically how long it would take for the lightning to disapear)
	2.5,				--FadeMovement (set to 0 to make it fade to the middle the higher it is the more it fade's to the side)
	0					--Sparks set to nil to disable		
)
67 Likes

This is really cool! Keep up the work and keep making interesting things.

2 Likes

looks dope!
super cool and looks really smooth, and the customisability is awesome

1 Like

I recommend using attributes instead of values.

4 Likes

Looks amazing! I might use this in my games later on, great contribution!

1 Like

i think you spelled lightning wrong in the title, but besides that this is really cool! nice work

1 Like

Looks really dope, don’t under estimate yourself when u compare yourself to others we all have to start from somewhere! But other then that I really like the idea might even use it on my future projects.

1 Like

That look so cool! but it can be use it as a force lightning like star wars?

2 Likes

yea, id say u will just have to adjust the speed to make it look like star war’s lightning

2 Likes

Nice. I hope you incorporate PartCache for better performance gain as well if the module creates a lot of parts.

1 Like

This is seriously the coolest lightning module I have ever seen. However, in real life, lightning bolts and electrical arcs don’t slowly travel along the path, it’s instant. Is there a way to turn that off? i.e. have the pattern change instantly every second or so rather than new bolts slowly travelling down?

1 Like

yes u can, if you put the fade effect to nil it will strike immediately

1 Like

Ah okay thank you, I was looking for it for a while but this one is perfect! ^^
Also for end of the lighting part can be on humanoid root and attachments than part?

yea you can use a part a mesh or an attachment as the end points :smiley:

2 Likes

Pretty cool! It’s easier to use than the other lightning module, the main reason why i use this.
I was able to make it strike at my mouse position, took me 10 minutes to find out how, but it was worth it!

1 Like

Could you share how you did it?

I’m trying to use an attachment but it keeps saying

  17:01:29.088  Size is not a valid member of Attachment "Workspace.FadedOrder.RightHand.HandAttachment"  -  Server - ShinsLightning:58

Sorry, but that will be a really long message, i changed the entire code and how it looks on both server-side and client-side scripts
Btw, about the problem with attachments, can you send a screenshot? In discord, we dont need to spam in here i think

sorry ill look into this and update the module if i see get any thing

I updated it, it shouldn’t have that problem any more :smiley:
using parts and attachments should work now thank you for pointing it out