So im making a lightsaber and when you press "E" the saber grows up with the tween service, its a tool and with in the tool is the local script for the saber to work, however when i press E to tween it it gives this error -
TweenService:Create failed because Instance is null - Client - LocalScript:21
****This is my local script What should i do?
local inputService = game:GetService("UserInputService")
local player = game.Players.LocalPlayer
local char = player.Character
local tweenService = game:GetService("TweenService")
local saber = script.Parent:FindFirstChild("Saber")
inputService.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.E then
local tweenInfo = TweenInfo.new(
3,
Enum.EasingStyle.Quint,
Enum.EasingDirection.Out,
0,
false,
1
)
local goals = {
Size = Vector3.new(3.522, 0.175, 0.894)
}
local makeTween = tweenService:Create(saber, tweenInfo, goals)
wait()
makeTween:Play()
print("Saber Open")
elseif input.KeyCode == Enum.KeyCode.Q then
print("Saber Closed")
end
end)
