Lightning module

Hello fellow developers! :smiley:

This is my first ever post on devforum and I’m very nervous about posting it. Anyways, I got bored yesterday and decided to make a lightning-thunder module. Just wanted to share it with you guys. It’s probably not well done since I made in 2 days but let me know what you think about it

If you have any ideas on how to make it better, I would really appreciate it if you tell me!

How the module works:

So the module takes two parts and creates attachments between them depending on how much attachments you want. The attachments are then connected with eachother by RopeConstraint for the visual effect

Once that’s done, I simply change the attachments position over and over so it give the lightning effect.

Gifs:
https://gyazo.com/d16c44a5668be36d1c7f0a42bf48273f
https://gyazo.com/8657e5e18530035efc38c689d87fbdf9

Module methods

Module.Create(): Creates a new “Lightning”.
".Create" takes those params:
StartPart: BasePart with attachment, EndPart: BasePart with attachment , SequenceNumber: number, DoDmg: boolean, TimeOut: time before it deletes it self (-1) if no, ExceptionList: table containing damage blacklist

Lightning:Begin(): Starts the visual effects.
Lightning:Yield(): Pauses the visual effects.
Lightning:Resume() Continues the visual effects.
Lightning:Destroy(): Destroys the “lightning”.

Simple example: :smile_cat:

local NewLightning = module.Create(workspace.Start, workspace.End, 25, true, 30, {Character})
NewLightning:Begin()

wait(5)
NewLightning:Yield()
wait(2)
NewLightning:Resume()
wait(3)
NewLightning:Destroy()

Again, this is my first time posting lol, hope you all like it and if you have any suggestions on how to make it better, don’t hesitate to tell me! :smile:

Free model here:

That’s it! :wave:

8 Likes

Would be great if you could add some images so people can see if this is what they need/want or not :+1:

2 Likes

Yeah, I totally forgot to do that, thanks for reminding me! :smiley:

2 Likes

This looks cool! How performance intensive is it? Also do you know the right settings to make this look at least decently realistic? I’m making a realistic game and this would be very nice to use

1 Like

Glad you liked it! Anyways, its decent from performence side and is not laggy but to be honest, I won’t use this module if I was going for a realistic game since its not really detailed as you can see from the images above. However, you can play with the settings however you like and maybe you’ll find yourself a good result :smiley:

1 Like