omgitspenguins
Active Member
Veteran
OmgStillAPenguin
Posts: 53
ROBLOX Username: penguins113311
|
Post by omgitspenguins on Apr 29, 2017 11:40:34 GMT
https://gyazo.com/7930548bcdab1959763833cdbbe2ed2c
How do you make something like this, It's pretty darn cool
|
|
jacob24068
New Member
Veteran
am old angry chinese man
Posts: 5
ROBLOX Username: iJacobness
|
Post by jacob24068 on Apr 29, 2017 14:56:22 GMT
|
|
|
Post by Xzeni on Apr 29, 2017 15:01:04 GMT
^
You can also make one yourself. The easiest way is just create points with a random position in front of the previous one and connect them using CFrame.
|
|
|
Post by goulstem on Apr 29, 2017 19:32:54 GMT
I could give the source code to the lightning module so you can see how it works :3
|
|
omgitspenguins
Active Member
Veteran
OmgStillAPenguin
Posts: 53
ROBLOX Username: penguins113311
|
Post by omgitspenguins on Apr 30, 2017 3:19:11 GMT
Surrre
|
|
|
Post by goulstem on Apr 30, 2017 14:37:14 GMT
genBolt = function(start,finish,sec) --start position, end position, sections in lightning
math.randomseed(tick());
local points = {};
local last = nil;
local m = math.random;
for i = 1,sec do
points[#points+1] = (CFrame.new(
start.X + (finish.X - start.X) * i/sec,
start.Y + (finish.Y - start.Y) * i/sec,
start.Z + (finish.Z - start.Z) * i/sec
) * CFrame.Angles(
math.rad(m(-180,180)),
math.rad(m(-180,180)),
math.rad(m(-180,180))
) * CFrame.new(0,0,m(0,10)/10)).p;
end
local m = Instance.new("Model",workspace);
m.Name = "Bolt"
for i,v in ipairs(points) do
if last ~= nil then
local dist = (v - last).magnitude;
local p = Instance.new("Part",m);
p.Name = "SubBolt";
p.FormFactor = "Custom";
p.CanCollide = false;
p.Anchored = true;
p.BrickColor = BrickColor.new("Bright yellow");
p.Transparency = 1;
p.Size = Vector3.new(.2,.2,dist);
p.CFrame = CFrame.new(last,v) * CFrame.new(0,0,-dist/2);
coroutine.wrap(function()
for i = 1,.5,-.05 do
p.Transparency = i;
wait();
end
end)();
wait();
end
last = v;
end
coroutine.wrap(function()
wait(.5)
for i = .5,1,.05 do
for _,v in next,m:GetChildren() do
v.Transparency = i;
end
wait();
end
m:Destroy();
end)()
end
|
|
|
Post by Bit on Apr 30, 2017 15:45:58 GMT
Thats pretty generous.
|
|
omgitspenguins
Active Member
Veteran
OmgStillAPenguin
Posts: 53
ROBLOX Username: penguins113311
|
Post by omgitspenguins on May 2, 2017 7:13:45 GMT
genBolt = function(start,finish,sec) --start position, end position, sections in lightning
math.randomseed(tick());
local points = {};
local last = nil;
local m = math.random;
for i = 1,sec do
points[#points+1] = (CFrame.new(
start.X + (finish.X - start.X) * i/sec,
start.Y + (finish.Y - start.Y) * i/sec,
start.Z + (finish.Z - start.Z) * i/sec
) * CFrame.Angles(
math.rad(m(-180,180)),
math.rad(m(-180,180)),
math.rad(m(-180,180))
) * CFrame.new(0,0,m(0,10)/10)).p;
end
local m = Instance.new("Model",workspace);
m.Name = "Bolt"
for i,v in ipairs(points) do
if last ~= nil then
local dist = (v - last).magnitude;
local p = Instance.new("Part",m);
p.Name = "SubBolt";
p.FormFactor = "Custom";
p.CanCollide = false;
p.Anchored = true;
p.BrickColor = BrickColor.new("Bright yellow");
p.Transparency = 1;
p.Size = Vector3.new(.2,.2,dist);
p.CFrame = CFrame.new(last,v) * CFrame.new(0,0,-dist/2);
coroutine.wrap(function()
for i = 1,.5,-.05 do
p.Transparency = i;
wait();
end
end)();
wait();
end
last = v;
end
coroutine.wrap(function()
wait(.5)
for i = .5,1,.05 do
for _,v in next,m:GetChildren() do
v.Transparency = i;
end
wait();
end
m:Destroy();
end)()
end
Oh wow thanks! I'm pretty lucky <3, I'll make sure to read through it and get the basic idea of it
|
|