Hello! I am trying to create lightning that looks realistic and strikes randomly. I have been trying to use this module script but I am not a very good scripter, so I do not know where I should put the scripts. The description of this module script has no instructions on how to use it, not on GitHub or in the scripts. Anyone know how?
You can read the github guide… The code is right there:
local LightningBolt = require(path.to.EvLightning)
local myBolt = LightningBolt.new(Vector3.new(0, 400, 0), Vector3.new(0, 0, 0), {
color = BrickColor.new("Really red");
-- More options are available, see below...
})
myBolt:Draw(workspace)
As I already said, I read the guide completely. I am asking where to put the scripts, like in replicated storage, replicated first, etc. The guide does not answer that.
Sorry, I misread the question. Put the module script inside ReplicatedStorage in the explorer (make sure that it’s named “EvLightning”). Next, you need to reference the module script. That’s very easy, and it will work in any script anywhere:
local replicatedStorage = game:GetService("ReplicatedStorage")
local evLightning = require(replicatedStorage:WaitForChild("EvLightning"))
Next, you need to use it. Lucky for you, that is on the github. Here’s a sample using the evLighting variable we created earlier:
local myBolt = evLightning.new(Vector3.new(0, 400, 0), Vector3.new(0, 0, 0), {
color = BrickColor.new("Really red");
-- More options on the github repo - https://github.com/evaera/EvLightning
})
myBolt:Draw(workspace)
At the end it should look like this:
