enixx_1
(enix)
June 10, 2022, 12:02pm
#1
So, I am almost done doing a lightsaber, But when it activates The size of it goes in both directions like this:
If someone knows a way to only make it go in 1 direction, Please say it in the replies.
Second thing is, How do i fix the orientation of the tool? Since it’s sideways I have tried changing it through putting the tool in workspace and fixing the orientation but that didn’t work, So if someone knows how to fix it I would highly appreciate it!
Tween both size and position because when tweening a part’s size, it’ll grow on both sides. Under the tools properties you can edit how your tool will appear in the players hand, this is just annoying though because if you have to just keep trying different numbers until the tool looks right.
1 Like
enixx_1
(enix)
June 10, 2022, 2:04pm
#3
About the tweening both size and position I have been constantly trying to do it, but unable to
Here is the script:
local Tool = script.Parent.Parent
local Saber = Tool.Saber
local UIS = game:GetService("UserInputService")
local Player = game.Players.LocalPlayer
local Handle = Tool.Handle
local Tween = game:GetService("TweenService")
local Info = TweenInfo.new(
0.5,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
0,
false
)
local ActivatedTable = {
Size = Vector3.new(Saber.Position.X + 5, 0, 0),
Position = Vector3.new(0, Saber.Position.Y + 4, 0)
}
local DeActivatedTable = {
Size = Vector3.new(0.3, 0.3, 1.5)
}
local ActivatedTween = Tween:Create(Saber, Info, ActivatedTable)
local DeActivatedTween = Tween:Create(Saber, Info, DeActivatedTable)
Tool.Equipped:Connect(function()
Player.PlayerGui.SaberControls.Enabled = true
UIS.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.Q then
print("Opening")
ActivatedTween:Play()
end
UIS.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.E then
print("Closing")
DeActivatedTween:Play()
end
end)
end)
end)
Tool.Unequipped:Connect(function()
Player.PlayerGui.SaberControls.Enabled = false
end)
If you could possibly try telling me how to, I would highly appreciate it! Thanks for the help!
Found this topic, may be of some use:
Im simply trying to tween a part’s size in its forward direction, the way i’ve tried to do this is to also tween the parts position forwards
But anything i’ve tried has either resulted in breaking the entire script or moving the part in the world’s X position
function FireLazer()
local clone = lazer:Clone()
clone.Parent = workspace
game:GetService("Debris"):AddItem(clone, 1)
clone.CFrame = myRoot:FindFirstChild("LazerPart").CFrame
local tweenService = game:GetService("TweenService")
lo…
1 Like