So this script is cloned inside of a part created and moved with another script inside of a tool. So basically what the script is trying to do is when it hits an object with a humanoid, it checks to see if the name is not equal to the casters name and d(debounce) is true(supposed to be false but I put true) . It then deletes the body velocity moving the part then, this is where it messes up. Torso gets Anchored, but RightArm does not. It gave me the error "right arm is not a valid member of model". So i tried to make RightArm = "Right Arm", as it is named Right Arm instead of RightArm in the Dummy(model). But it still does not work. Excuse my ignorance and my bad indentation as I am new to scripting, any help is appreciated and I realize I am probably just an idiot missing something small.
local player = script.Parent.Name
local d = true
local RightArm = "Right Arm"
local LeftArm = "Left Arm"
local RightLeg = "Right Leg"
local LeftLeg = "Left Leg"
local function onT(p)
if p.Parent:FindFirstChild("Humanoid") ~= nil and p.Parent.Name ~= player.Name and d == true then
d = false
script.Parent.BodyVelocity:Destroy()
p.Parent.Torso.Anchored = true
p.Parent.Head.Anchored = true
p.Parent.RightArm.Anchored = true
p.Parent.LeftArm.Anchored = true
p.Parent.RightLeg.Anchored = true
p.Parent.LeftLeg.Anchored = true
p.Parent.Head.Anchored = true
script.Parent.Anchored = true
script.Parent.CFrame = p.Parent.Torso.CFrame
local w = Instance.new("Weld")
w.Part0 = script.Parent
w.Part1 = p.Parent
w.C0 = CFrame.new(0, 0, 0)
for i = 1, 10 do
p.Parent.Torso.CFrame = p.Parent.Torso.CFrame + CFrame.new(0, i*2, 0)
script.parent.Size = script.Parent.Size + Vector3.new(i*1.5, i*1.5, i*1.5)
end
end
end
script.Parent.Touched:connect(onT)

1 comment
In addition to what yoshi8080 said, you can also do local var = "Right Arm" local arm = game.Workspace.Player1[var] (but for these cases, the way yoshi8080 shows is better).