I am trying to make the right arm stretch behind the character, charging an attack. I'm using Tween to make it stretch, and also I used a welding code that someone gave me to help me fix this problem, but it didn't. I think he did it right, it's just that I don't know what I'm doing. The issue I'm having is that it stretches both forward and backward, which is not what I want. Someone, please help!!

Server Script #1 (is the child of ServerScriptService)

local debounce = true
game.ReplicatedStorage.Events.gumCharge.OnServerEvent:Connect(function(player)
	local Tween = game:GetService("TweenService")
	local char = player.Character or player.CharacterAdded:Wait()
	local rArm = {ruArm = char:WaitForChild("RightUpperArm"), rlArm = char:WaitForChild("RightLowerArm"), rHand = char:WaitForChild("RightHand")}
	local info = TweenInfo.new(
		2,                        --Length(seconds)
		Enum.EasingStyle.Sine,   
		Enum.EasingDirection.Out,
		0,                        --Times Repeated
		false,                    --Reverse
		.5)                       --Delay (seconds)
	
	local ruSize = {Size = Vector3.new(1, 21.849, 1)} 
	local rlSize = {Size = Vector3.new(1, 15.582, 1)}
	local rSize = {Size = Vector3.new(1, 0.3, 1)}
	
	local ruTween = Tween:Create(rArm.ruArm, info, ruSize)
	local rlTween = Tween:Create(rArm.rlArm, info, rlSize)
	local rTween = Tween:Create(rArm.rHand, info, rSize)
	
	if debounce then
		local ruWeld = game:GetService("ServerScriptService").gumWeld:Clone()
		local rlWeld = game:GetService("ServerScriptService").gumWeld:Clone()
		local rWeld = game:GetService("ServerScriptService").gumWeld:Clone()
	
		ruWeld.Parent = rArm.ruArm
		rlWeld.Parent = rArm.rlArm
		rWeld.Parent = rArm.rHand
		
		debounce = false
	end
	
	ruTween:Play()
	rlTween:Play()
	rTween:Play()
	
end)

Server Script #2 (child of ServerScriptService)

local weld
local success, errormessage = pcall(function()
    weld = Instance.new("Weld")
end)

if success then
    weld.Parent = script.Parent
    script.Parent:WaitForChild(weld).C0 = CFrame.new(script.Parent.Position * CFrame.new(0, script.Parent.Size.Y/2, 0));
end

1 comment

0

I think you should try to tween it to go forwards as it streches but idk thats only a suggestion..