decided to make a fire slash effect and its a reference from an anime.
Just need feedback and tips on how to improve this.
Oh yeah.
I only used beams and instance.news
decided to make a fire slash effect and its a reference from an anime.
Just need feedback and tips on how to improve this.
Oh yeah.
I only used beams and instance.news
This looks really nice, but perhaps a tiny trail of steam could make it look a tiny bit more realistic, and on a weapon could possibly looks nice. Overall, great work!
This looks sick! But how did you make this?
It’s just a really complex piece of code I’ve been trying to perfect for 6 hours, but to simplify it. A function to create a part to hold all attachments and beams, a function to create the attachments and beams every render wait in a pre determined direction and to finish it off some fire spark effects. I will post the entire code for it later, it’s just one script with no additional parts so you could just paste it in a local script to test it yourself
Thank you. I unfortunately cant heart posts for the next 11 hours due to me liking a lot of posts
This looks very cool for a more cartoony game. the very end of the trail looks very off because it is blunt and doesn’t taper back down.
Oh! Thank for explaining this!
It totally will help me in teh future
Nice work, your effects are super cool and the way you use beams to make them is even cooler
local uis = game:GetService("UserInputService")
local run = game:GetService("RunService")
local ts = game:GetService("TweenService")
local ti1 = TweenInfo.new(1,0,0)
local ti2 = TweenInfo.new(0.3,0,0)
local key = Enum.KeyCode.E
local key2 = Enum.KeyCode.R
local key3 = Enum.KeyCode.T
local function begin(char)
local lastwidth = 1
local width = 0.4
local cframe = CFrame.new(0,5,0)
local lastdetermined = 0
local function randoms(min,max)
return math.random(min, max)
end
local function determined_randoms(min,max)
local value = width
local luck = math.random(1,4)
if luck < 4 then
local deter = 0
if lastdetermined <= 0 then
deter = math.random(min, 0)
else
deter = math.random(0, max)
end
lastdetermined = deter
return deter
else
local deter = math.random(min, max)
lastdetermined = deter
return deter
end
end
local function makespark(base)
local at1, at2, at3, at4 = Instance.new("Attachment",base), Instance.new("Attachment",base), Instance.new("Attachment",base), Instance.new("Attachment",base)
local b1, b2, b3 = Instance.new("Beam",base), Instance.new("Beam",base), Instance.new("Beam",base)
local c = cframe * CFrame.new(width,0,0)
at1.WorldCFrame = c
at2.WorldCFrame = c
at3.WorldCFrame = c
at4.WorldCFrame = c
b1.Attachment0 = at1
b1.Attachment1 = at2
b2.Attachment0 = at2
b2.Attachment1 = at3
b3.Attachment0 = at3
b3.Attachment1 = at4
b1.Width0 = 0
b1.Width1 = 0.2
b2.Width0 = 0.2
b2.Width1 = 0.4
b3.Width0 = 0.4
b3.Width1 = 0.1
b1.FaceCamera = true
b2.FaceCamera = true
b3.FaceCamera = true
b1.Color = ColorSequence.new(Color3.fromRGB(255,30,0),Color3.fromRGB(255,50,0))
b2.Color = ColorSequence.new(Color3.fromRGB(255,50,0),Color3.fromRGB(255,70,0))
b3.Color = ColorSequence.new(Color3.fromRGB(255,70,0),Color3.fromRGB(255,90,0))
b1.Transparency = NumberSequence.new(0,0)
b2.Transparency = NumberSequence.new(0,0)
b3.Transparency = NumberSequence.new(0,0)
b1.LightInfluence = 0
b2.LightInfluence = 0
b3.LightInfluence = 0
b2.LightEmission = 0
b3.LightEmission = 0
b2.Brightness = 3
b3.Brightness = 3
local c1 = width + randoms(2,4)
local c2 = randoms(-4,4)
spawn(function()
ts:Create(at1,ti2,{WorldCFrame = c * CFrame.new(c1,0,c2) }):Play()
wait(0.05)
ts:Create(at2,ti2,{WorldCFrame = c * CFrame.new(c1,0,c2) }):Play()
wait(0.05)
ts:Create(at3,ti2,{WorldCFrame = c * CFrame.new(c1,0,c2)}):Play()
wait(0.05)
ts:Create(at4,ti2,{WorldCFrame = c * CFrame.new(c1,0,c2)}):Play()
end)
end
local function makespark2(base)
local at1, at2, at3, at4 = Instance.new("Attachment",base), Instance.new("Attachment",base), Instance.new("Attachment",base), Instance.new("Attachment",base)
local b1, b2, b3 = Instance.new("Beam",base), Instance.new("Beam",base), Instance.new("Beam",base)
local c = cframe * CFrame.new(width,0,0)
at1.WorldCFrame = c
at2.WorldCFrame = c
at3.WorldCFrame = c
at4.WorldCFrame = c
b1.Attachment0 = at1
b1.Attachment1 = at2
b2.Attachment0 = at2
b2.Attachment1 = at3
b3.Attachment0 = at3
b3.Attachment1 = at4
b1.Width0 = 0
b1.Width1 = 0.2
b2.Width0 = 0.2
b2.Width1 = 0.4
b3.Width0 = 0.4
b3.Width1 = 0.1
b1.FaceCamera = true
b2.FaceCamera = true
b3.FaceCamera = true
b1.Color = ColorSequence.new(Color3.fromRGB(255,30,0),Color3.fromRGB(255,50,0))
b2.Color = ColorSequence.new(Color3.fromRGB(255,50,0),Color3.fromRGB(255,70,0))
b3.Color = ColorSequence.new(Color3.fromRGB(255,70,0),Color3.fromRGB(255,90,0))
b1.Transparency = NumberSequence.new(0,0)
b2.Transparency = NumberSequence.new(0,0)
b3.Transparency = NumberSequence.new(0,0)
b1.LightInfluence = 0
b2.LightInfluence = 0
b3.LightInfluence = 0
b2.LightEmission = 0
b3.LightEmission = 0
b2.Brightness = 3
b3.Brightness = 3
local c1 = -(width + randoms(2,4))
local c2 = randoms(-4,4)
spawn(function()
ts:Create(at1,ti2,{WorldCFrame = c * CFrame.new(c1,0,c2) }):Play()
wait(0.05)
ts:Create(at2,ti2,{WorldCFrame = c * CFrame.new(c1,0,c2) }):Play()
wait(0.05)
ts:Create(at3,ti2,{WorldCFrame = c * CFrame.new(c1,0,c2)}):Play()
wait(0.05)
ts:Create(at4,ti2,{WorldCFrame = c * CFrame.new(c1,0,c2)}):Play()
end)
end
local function makeflame(base,c)
local at1, at2, at3, at4, at5 = Instance.new("Attachment",base), Instance.new("Attachment",base), Instance.new("Attachment",base), Instance.new("Attachment",base), Instance.new("Attachment",base)
local b1, b2, b3, b4 = Instance.new("Beam",base), Instance.new("Beam",base), Instance.new("Beam",base), Instance.new("Beam",base)
local rand = width + 0.1
local rand2 = width + 0.2
local rand3 = width + 0.4
local rand4 = width + 0.6
at1.WorldCFrame = cframe * CFrame.Angles(math.rad(90),0,0)
at2.WorldCFrame = cframe * CFrame.Angles(math.rad(90),0,0)
at3.WorldCFrame = cframe * CFrame.Angles(math.rad(90),0,0)
at4.WorldCFrame = cframe * CFrame.Angles(math.rad(90),0,0)
at5.WorldCFrame = cframe * CFrame.Angles(math.rad(90),0,0)
local a1 = (cframe * CFrame.Angles(0,math.rad(0),0)) * CFrame.new(width,0,0) * CFrame.Angles(math.rad(90),0,0)
local a2 =(cframe * CFrame.Angles(0,math.rad(0),0)) * CFrame.new(rand ,0,0) * CFrame.Angles(math.rad(90),0,0)
local a3 = (cframe * CFrame.Angles(0,math.rad(0),0)) * CFrame.new(rand2 ,0,0) * CFrame.Angles(math.rad(90),0,0)
local a4 = (cframe * CFrame.Angles(0,math.rad(0),0)) * CFrame.new(rand3 ,0,0) * CFrame.Angles(math.rad(90),0,0)
local a5 = (cframe * CFrame.Angles(0,math.rad(0),0)) * CFrame.new(rand4 ,0,0) * CFrame.Angles(math.rad(90),0,0)
spawn(function()
wait(0.5)
local a1c = (c * CFrame.Angles(0,math.rad(0),0)) * CFrame.new(0,0,0) * CFrame.Angles(math.rad(90),0,0)
local a2c =(c * CFrame.Angles(0,math.rad(0),0)) * CFrame.new(0,0,0) * CFrame.Angles(math.rad(90),0,0)
local a3c = (c * CFrame.Angles(0,math.rad(0),0)) * CFrame.new(0,0,0) * CFrame.Angles(math.rad(90),0,0)
local a4c = (c * CFrame.Angles(0,math.rad(0),0)) * CFrame.new(0,0,0) * CFrame.Angles(math.rad(90),0,0)
local a5c = (c * CFrame.Angles(0,math.rad(0),0)) * CFrame.new(0,0,0) * CFrame.Angles(math.rad(90),0,0)
ts:Create(at1,ti2,{WorldCFrame = a1c}):Play()
ts:Create(at2,ti2,{WorldCFrame = a2c}):Play()
ts:Create(at3,ti2,{WorldCFrame = a3c}):Play()
ts:Create(at4,ti2,{WorldCFrame = a4c}):Play()
ts:Create(at5,ti2,{WorldCFrame = a5c}):Play()
end)
ts:Create(at1,ti2,{WorldCFrame = a1}):Play()
ts:Create(at2,ti2,{WorldCFrame = a2}):Play()
ts:Create(at3,ti2,{WorldCFrame = a3}):Play()
ts:Create(at4,ti2,{WorldCFrame = a4}):Play()
ts:Create(at5,ti2,{WorldCFrame = a5}):Play()
b1.Attachment0 = at1
b1.Attachment1 = at2
b2.Attachment0 = at2
b2.Attachment1 = at3
b3.Attachment0 = at3
b3.Attachment1 = at4
b4.Attachment0 = at4
b4.Attachment1 = at5
local rande = math.random(1,5)/10
local rande2 = math.random(1,5)/10
local rande3 = math.random(1,5)/10
b1.Width0 = 0.25
b1.Width1 = 0.25
b2.Width0 = 0.25
b2.Width1 = 0.25
b3.Width0 = 0.25
b3.Width1 = 0.25
b4.Width0 = 0.25
b4.Width1 = 0.25
b4.Color = ColorSequence.new(Color3.fromRGB(255,70,0),Color3.fromRGB(255,30,0))
b3.Color = ColorSequence.new(Color3.fromRGB(255,120,0),Color3.fromRGB(255,70,0))
b2.Color = ColorSequence.new(Color3.fromRGB(255,210,80),Color3.fromRGB(255,120,0))
b1.Color = ColorSequence.new(Color3.fromRGB(0,0,0))
b1.Transparency = NumberSequence.new(0,0)
b2.Transparency = NumberSequence.new(0,0)
b3.Transparency = NumberSequence.new(0,0)
b4.Transparency = NumberSequence.new(0,0)
b1.LightInfluence = 0
b2.LightInfluence = 0
b3.LightInfluence = 0
b4.LightInfluence = 0
b2.LightEmission = 0
b3.LightEmission = 0
b4.LightEmission = 0
b2.Brightness = 3
b3.Brightness = 3
b4.Brightness = 3
end
local function makeflame2(base,c)
local at1, at2, at3, at4, at5 = Instance.new("Attachment",base), Instance.new("Attachment",base), Instance.new("Attachment",base), Instance.new("Attachment",base), Instance.new("Attachment",base)
local b1, b2, b3, b4 = Instance.new("Beam",base), Instance.new("Beam",base), Instance.new("Beam",base), Instance.new("Beam",base)
local rand = width + 0.1
local rand2 = width + 0.2
local rand3 = width + 0.4
local rand4 = width + 0.6
at1.WorldCFrame = (cframe * CFrame.Angles(0,math.rad(180),0)) * CFrame.Angles(math.rad(90),0,0)
at2.WorldCFrame = (cframe * CFrame.Angles(0,math.rad(180),0)) * CFrame.Angles(math.rad(90),0,0)
at3.WorldCFrame = (cframe * CFrame.Angles(0,math.rad(180),0)) * CFrame.Angles(math.rad(90),0,0)
at4.WorldCFrame = (cframe * CFrame.Angles(0,math.rad(180),0)) * CFrame.Angles(math.rad(90),0,0)
at5.WorldCFrame = (cframe * CFrame.Angles(0,math.rad(180),0)) * CFrame.Angles(math.rad(90),0,0)
local a1 = (cframe * CFrame.Angles(0,math.rad(180),0)) * CFrame.new(width,0,0) * CFrame.Angles(math.rad(90),0,0)
local a2 =(cframe * CFrame.Angles(0,math.rad(180),0)) * CFrame.new(rand ,0,0) * CFrame.Angles(math.rad(90),0,0)
local a3 = (cframe * CFrame.Angles(0,math.rad(180),0)) * CFrame.new(rand2 ,0,0) * CFrame.Angles(math.rad(90),0,0)
local a4 = (cframe * CFrame.Angles(0,math.rad(180),0)) * CFrame.new(rand3 ,0,0) * CFrame.Angles(math.rad(90),0,0)
local a5 = (cframe * CFrame.Angles(0,math.rad(180),0)) * CFrame.new(rand4 ,0,0) * CFrame.Angles(math.rad(90),0,0)
spawn(function()
wait(0.5)
local a1c = (c * CFrame.Angles(0,math.rad(180),0)) * CFrame.new(0,0,0) * CFrame.Angles(math.rad(90),0,0)
local a2c =(c * CFrame.Angles(0,math.rad(180),0)) * CFrame.new(0,0,0) * CFrame.Angles(math.rad(90),0,0)
local a3c = (c * CFrame.Angles(0,math.rad(180),0)) * CFrame.new(0,0,0) * CFrame.Angles(math.rad(90),0,0)
local a4c = (c * CFrame.Angles(0,math.rad(180),0)) * CFrame.new(0,0,0) * CFrame.Angles(math.rad(90),0,0)
local a5c = (c * CFrame.Angles(0,math.rad(180),0)) * CFrame.new(0,0,0) * CFrame.Angles(math.rad(90),0,0)
ts:Create(at1,ti2,{WorldCFrame = a1c}):Play()
ts:Create(at2,ti2,{WorldCFrame = a2c}):Play()
ts:Create(at3,ti2,{WorldCFrame = a3c}):Play()
ts:Create(at4,ti2,{WorldCFrame = a4c}):Play()
ts:Create(at5,ti2,{WorldCFrame = a5c}):Play()
end)
ts:Create(at1,ti2,{WorldCFrame = a1}):Play()
ts:Create(at2,ti2,{WorldCFrame = a2}):Play()
ts:Create(at3,ti2,{WorldCFrame = a3}):Play()
ts:Create(at4,ti2,{WorldCFrame = a4}):Play()
ts:Create(at5,ti2,{WorldCFrame = a5}):Play()
b1.Attachment0 = at1
b1.Attachment1 = at2
b2.Attachment0 = at2
b2.Attachment1 = at3
b3.Attachment0 = at3
b3.Attachment1 = at4
b4.Attachment0 = at4
b4.Attachment1 = at5
local rande = math.random(1,5)/10
local rande2 = math.random(1,5)/10
local rande3 = math.random(1,5)/10
b1.Width0 = 0.25
b1.Width1 = 0.25
b2.Width0 = 0.25
b2.Width1 = 0.25
b3.Width0 = 0.25
b3.Width1 = 0.25
b4.Width0 = 0.25
b4.Width1 = 0.25
b4.Color = ColorSequence.new(Color3.fromRGB(255,70,0),Color3.fromRGB(255,30,0))
b3.Color = ColorSequence.new(Color3.fromRGB(255,120,0),Color3.fromRGB(255,70,0))
b2.Color = ColorSequence.new(Color3.fromRGB(255,210,80),Color3.fromRGB(255,120,0))
b1.Color = ColorSequence.new(Color3.fromRGB(0,0,0))
b1.Transparency = NumberSequence.new(0,0)
b2.Transparency = NumberSequence.new(0,0)
b3.Transparency = NumberSequence.new(0,0)
b4.Transparency = NumberSequence.new(0,0)
b1.LightInfluence = 0
b2.LightInfluence = 0
b3.LightInfluence = 0
b4.LightInfluence = 0
b2.LightEmission = 0
b3.LightEmission = 0
b4.LightEmission = 0
b2.Brightness = 3
b3.Brightness = 3
b4.Brightness = 3
end
local function setcf()
cframe = (cframe * CFrame.Angles(math.rad(0.3),math.rad(0.6),0)) + (cframe * CFrame.Angles(math.rad(0.3),math.rad(0.6),0)).LookVector * 0.2
end
local function setwidth()
width = math.clamp(width + determined_randoms(-5,5)/125 , 0.3, 1.2)
end
local function firepart(base,c)
local atf1, atf2, atb1, atb2, atf12, atf22, atb12, atb22 = Instance.new("Attachment",base), Instance.new("Attachment",base), Instance.new("Attachment",base), Instance.new("Attachment",base), Instance.new("Attachment",base), Instance.new("Attachment",base), Instance.new("Attachment",base), Instance.new("Attachment",base)
local bf1, bf2, bb1, bb2 = Instance.new("Beam",base), Instance.new("Beam",base), Instance.new("Beam",base), Instance.new("Beam",base)
atf1.WorldCFrame = cframe * CFrame.new(0,0,0) * CFrame.Angles(math.rad(90),0,0)
atf2.WorldCFrame = cframe * CFrame.new(0,0,0) * CFrame.Angles(math.rad(90),0,0)
bf1.Attachment0 = atf1
bf1.Attachment1 = atf2
atb1.WorldCFrame = cframe * CFrame.new(0,0,0) * CFrame.Angles(math.rad(90),0,0)
atb2.WorldCFrame = cframe * CFrame.new(0,0,0) * CFrame.Angles(math.rad(90),0,0)
bf2.Attachment0 = atb1
bf2.Attachment1 = atb2
atf12.WorldCFrame = cframe * CFrame.new(0,0,0) * CFrame.Angles(math.rad(90),0,0)
atf22.WorldCFrame = cframe * CFrame.new(0,0,0) * CFrame.Angles(math.rad(90),0,0)
bb1.Attachment0 = atf12
bb1.Attachment1 = atf22
atb12.WorldCFrame = cframe * CFrame.new(0,0,0) * CFrame.Angles(math.rad(90),0,0)
atb22.WorldCFrame = cframe * CFrame.new(0,0,0) * CFrame.Angles(math.rad(90),0,0)
bb2.Attachment0 = atb12
bb2.Attachment1 = atb22
ts:Create(atf1,ti2,{WorldCFrame = cframe * CFrame.new(width,0,0) * CFrame.Angles(math.rad(90),0,0)}):Play()
ts:Create(atf2,ti2,{WorldCFrame = cframe * CFrame.new(0,0.3,0) * CFrame.Angles(math.rad(90),0,0)}):Play()
ts:Create(atb1,ti2,{WorldCFrame = cframe * CFrame.new(0,0.3,0) * CFrame.Angles(math.rad(90),0,0)}):Play()
ts:Create(atb2,ti2,{WorldCFrame = cframe * CFrame.new(-width,0,0) * CFrame.Angles(math.rad(90),0,0)}):Play()
ts:Create(atf12,ti2,{WorldCFrame = cframe * CFrame.new(width,0,0) * CFrame.Angles(math.rad(90),0,0)}):Play()
ts:Create(atf22,ti2,{WorldCFrame = cframe * CFrame.new(0,-0.3,0) * CFrame.Angles(math.rad(90),0,0)}):Play()
ts:Create(atb12,ti2,{WorldCFrame = cframe * CFrame.new(0,-0.3,0) * CFrame.Angles(math.rad(90),0,0)}):Play()
ts:Create(atb22,ti2,{WorldCFrame = cframe * CFrame.new(-width,0,0) * CFrame.Angles(math.rad(90),0,0)}):Play()
spawn(function()
wait(0.5)
ts:Create(atf1,ti2,{WorldCFrame = c * CFrame.new(0,0,0) * CFrame.Angles(math.rad(90),0,0)}):Play()
ts:Create(atf2,ti2,{WorldCFrame = c * CFrame.new(0,0,0) * CFrame.Angles(math.rad(90),0,0)}):Play()
ts:Create(atb1,ti2,{WorldCFrame = c * CFrame.new(0,0,0) * CFrame.Angles(math.rad(90),0,0)}):Play()
ts:Create(atb2,ti2,{WorldCFrame = c * CFrame.new(0,0,0) * CFrame.Angles(math.rad(90),0,0)}):Play()
ts:Create(atf12,ti2,{WorldCFrame = c * CFrame.new(0,0,0) * CFrame.Angles(math.rad(90),0,0)}):Play()
ts:Create(atf22,ti2,{WorldCFrame = c * CFrame.new(0,0,0) * CFrame.Angles(math.rad(90),0,0)}):Play()
ts:Create(atb12,ti2,{WorldCFrame = c * CFrame.new(0,0,0) * CFrame.Angles(math.rad(90),0,0)}):Play()
ts:Create(atb22,ti2,{WorldCFrame = c * CFrame.new(0,0,0) * CFrame.Angles(math.rad(90),0,0)}):Play()
end)
bf1.Width0 = 0.2
bf1.Width1 = 0.2
bf2.Width0 = 0.2
bf2.Width1 = 0.2
bb1.Width0 = 0.2
bb1.Width1 = 0.2
bb2.Width0 = 0.2
bb2.Width1 = 0.2
bf1.Color = ColorSequence.new(Color3.fromRGB(255,015,0))
bf2.Color = ColorSequence.new(Color3.fromRGB(255,015,0))
bb1.Color = ColorSequence.new(Color3.fromRGB(255,015,0))
bb2.Color = ColorSequence.new(Color3.fromRGB(255,015,0))
bf1.LightInfluence = 0
bf2.LightInfluence = 0
bb1.LightInfluence = 0
bb2.LightInfluence = 0
bf1.LightEmission = 0
bf2.LightEmission = 0
bb1.LightEmission = 0
bb2.LightEmission = 0
bf1.Transparency = NumberSequence.new(0,0)
bf2.Transparency = NumberSequence.new(0,0)
bb1.Transparency = NumberSequence.new(0,0)
bb2.Transparency = NumberSequence.new(0,0)
bf1.Brightness = 44
bf2.Brightness = 44
bb1.Brightness = 44
bb2.Brightness = 44
if randoms(1,8) == 3 then
makespark(base)
end
if randoms(1,8) == 3 then
makespark2(base)
end
makeflame(base,c)
makeflame2(base,c)
setcf()
setwidth()
end
local function start(char)
local part = Instance.new("Part",workspace)
part.Anchored = true
part.Size = Vector3.new(0.01,0.01,0.01)
part.CFrame = char.HumanoidRootPart.CFrame
part.CanCollide = false
cframe = (char.HumanoidRootPart.CFrame * CFrame.Angles(0,0,math.rad(randoms(1,360)))) * CFrame.new(15,0,3) * CFrame.Angles(0,math.rad(35),0)
local sfx = Instance.new("Sound",part)
sfx.SoundId = "rbxassetid://7278163473"
sfx.PlaybackSpeed = 2
sfx:Play()
game.Debris:AddItem(part,1.5)
spawn(function()
for i = 1, 150, 1 do
firepart(part,cframe)
if i%5 == 0 then
run.RenderStepped:Wait()
end
end
end)
end
start(char)
end
local p = game.Players.LocalPlayer
uis.InputBegan:Connect(function(keying,typing)
if typing then return end
if keying.KeyCode == key then
local char = p.Character
begin(char)
end
end)
uis.InputBegan:Connect(function(keying,typing)
if typing then return end
if keying.KeyCode == key2 then
local char = p.Character
for i = 1, 6 do
begin(char)
wait(0.75)
end
end
end)
uis.InputBegan:Connect(function(keying,typing)
if typing then return end
if keying.KeyCode == key3 then
local char = p.Character
for i = 1, 3 do
begin(char)
end
end
end)
if you are gonna use this in any of your projects, i recommend to deviate from the looks of the original effect