Ok so for my game im trying to stretch a arm out, (if you can explain why it just gets bigger too)
but whenever I activate the tween the problem that I get is that the object disappears after usage as intended (if im not trying to remove it, I get an error for removing) but when I reuse it stays the same size as before like when I use the clone again its the same clone cuz I canβt remove that clone
script:
local GumGumPistol = game:GetService("ReplicatedStorage"):WaitForChild("RubberFruit_Events").GumPistol
local RS = game:GetService("ReplicatedStorage")
local GumGumPistol = game:GetService("ReplicatedStorage"):WaitForChild("RubberFruit_Events").GumPistol
local RS = game:GetService("ReplicatedStorage")
local GumPunch = Instance.new("Animation")
local GumGumPistol = game:GetService("ReplicatedStorage"):WaitForChild("RubberFruit_Events").GumPistol
GumPunch.AnimationId = "http://www.roblox.com/Asset?ID=13495201168" --AnimId
local VFX = game:GetService("ReplicatedStorage").RubberFruit_VFX
Vclone = VFX.Punch:Clone()
VStretchArm = VFX.StretchArm:Clone()
local TweenService = game:GetService("TweenService")
local Info = TweenInfo.new(
4, --Length seconds
Enum.EasingStyle.Linear, --Animate Style
Enum.EasingDirection.Out, --Direction
0, --Repeat times 0 is 1 time
true, --Go back to normal true is better
0 --Delay
)
local Goals = {Size = Vector3.new(10, 10, 10)}
local Tween = TweenService:Create(VStretchArm, Info, Goals)
local function TrashTween()
VStretchArm:Destroy()
end
GumGumPistol.OnServerEvent:Connect(function(player, PistolTrigger)
print("RecievedEvent")
print("BeginningStretch")
wait(0.1)
end)
GumGumPistol.OnServerEvent:Connect(function(player)
GumPunch.Parent = player.Character
local animTrack = player.Character.Humanoid:WaitForChild("Animator"):LoadAnimation(GumPunch)
animTrack:Play()
Vclone.Parent = player.Character.RightHand
Vclone.Enabled = true
VStretchArm.Parent = player.Character
VStretchArm.Position = player.Character.RightHand.Position
VStretchArm.WeldConstraint.Part0 = player.Character.RightHand
VStretchArm.WeldConstraint.Part1 = VStretchArm
wait(.1)
Tween:Play()
Vclone.Parent = game.ReplicatedStorage.ParticleDebris
wait(.05)
VStretchArm.Parent = game.ReplicatedStorage.ParticleDebris
TrashTween() --this gives me a error cuz the parent becomes null cuz it tries to reuse the same clone and since the clone is now destroyed it like cant do that and breaks
end)