Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-3

can some tell me why this won't run in sb? [closed]

Asked by 8 years ago
local Player = game.Players.LocalPlayer
local Character = game.Workspace:WaitForChild(Player.Name)
local Torso = Character:WaitForChild("Torso")
local LArm = Character:WaitForChild("Left Arm")
local RArm = Character:WaitForChild("Right Arm")

local Weld = Instance.new("Weld",LArm)
Weld.Part0 = LArm
Weld.Part1 = Torso
Weld.C0 = CFrame.new(1.5,0,0)

local Target = Weld.C0 * CFrame.new(0,1,0) * CFrame.Angles(0,0,math.rad(45))

local Speed = 0.4
wait(3)

game:GetService("RunService").RenderStep­ped:connect(function()
Weld.C0 = Weld.C0:lerp(Target,Speed) 
end)
0
What are you asking? TheHospitalDev 1134 — 8y
0
^ User#11440 120 — 8y

Closed as Not Constructive by gskw, TheHospitalDev, and User#6546

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by
Vaeb 30
8 years ago

You need to remove the current Shoulder motor otherwise your new Weld won't affect the arm. Like this:

local Player = game.Players.LocalPlayer
local Character = game.Workspace:WaitForChild(Player.Name)
local Torso = Character:WaitForChild("Torso")
local LArm = Character:WaitForChild("Left Arm")
local RArm = Character:WaitForChild("Right Arm")

Torso:WaitForChild("Left Shoulder"):Destroy()

local Weld = Instance.new("Weld",LArm)
Weld.Part0 = LArm
Weld.Part1 = Torso
Weld.C0 = CFrame.new(1.5,0,0)

local Target = Weld.C0 * CFrame.new(0,1,0) * CFrame.Angles(0,0,math.rad(45))

local Speed = 0.4
wait(3)

game:GetService("RunService").RenderStepped:connect(function()
Weld.C0 = Weld.C0:lerp(Target,Speed) 
end)
Ad