I have been trying to get the lightsaber blade to be animated when it turn on but it keep showed a output error that said this:
08:45:46.438 TweenService:Create failed because Instance is null
08:45:46.438 Script ‘Players.DeathLilian.Backpack.Test.Blade_animate 2’, Line 35
The red blade suppose to show up inside the black beam.
Here a script
local tweenService = game:GetService("TweenService")
local Users=game:GetService("Players")
local User=script.Parent.Parent.Parent
local Tool=script.Parent
local B = Tool:WaitForChild("B")
local B2 = Tool:WaitForChild("B2")
local Em = Tool.Emitter
local Enabler = B:WaitForChild("Burn")
local weldB, weldB2
for i, v in pairs(Tool:WaitForChild("Handle"):GetChildren()) do
if v.ClassName == "Weld" then
if v.Part1 == B then
weldB = v
elseif v.Part1 == B2 then
weldB2 = v
end
end
end
local tweeningInformation = TweenInfo.new(
0.25,
Enum.EasingStyle.Linear,
Enum.EasingDirection.InOut,
0,
false,
0
)
local up2 = {C0 = CFrame.new(0, 2.25, 0)};
local up = {Size = Vector3.new(0.121, 4.6, 0.121)};
local down2 = {C0 = CFrame.new(0, -0.05, 0)};
local down = {Size = Vector3.new(0.121, 0.05, 0.121)}
local Tween1 = tweenService:Create(B2,tweeningInformation,up)
local Tween2 = tweenService:Create(B2,tweeningInformation,down)
local Tween3 = tweenService:Create(weldB2,tweeningInformation,up2)
local Tween4 = tweenService:Create(weldB2,tweeningInformation,down2)
Enabler:GetPropertyChangedSignal("Value"):connect(function()
if Enabler.Value then
Tween1:Play()
Tween3:Play()
else
Tween2:Play()
Tween4:Play()
end
end)
Is there a way to fix it?