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

attempt to concatenate string with userdata?

Asked by 4 years ago
-- Settings
local name = owner.Name
-- Head
local head = Instance.new("Part")
head.Parent = game.Workspace
head.Name = "head"
head.Anchored = true
head.CanCollide = false
head.Size = Vector3.new(2, 1, 1)
-- Face
local face = Instance.new("Decal")
face.Parent = head
face.Texture = "rbxasset://textures/face.png"
face.Name = "face"
face.Face = "Front"
-- Torso
local torso = Instance.new("Part")
torso.Parent = game.Workspace
torso.Name = "torso"
torso.Anchored = true
torso.CanCollide = false
torso.Size = Vector3.new(2, 2, 1)
-- Left Arm
local larm = Instance.new("Part")
larm.Parent = game.Workspace
larm.Name = "larm"
larm.Anchored = true
larm.CanCollide = false
larm.Size = Vector3.new(1, 2, 1)
-- Right Arm
local rarm = Instance.new("Part")
rarm.Parent = game.Workspace
rarm.Name = "rarm"
rarm.Anchored = true
rarm.CanCollide = false
rarm.Size = Vector3.new(1, 2, 1)
-- Left Leg
local lleg = Instance.new("Part")
lleg.Parent = game.Workspace
lleg.Name = "lleg"
lleg.Anchored = true
lleg.CanCollide = false
lleg.Size = Vector3.new(1, 2, 1)
-- Right Leg
local rleg = Instance.new("Part")
rleg.Parent = game.Workspace
rleg.Name = "rleg"
rleg.Anchored = true
rleg.CanCollide = false
rleg.Size = Vector3.new(1, 2, 1)
-- Animation
while true do
    wait()
    -- Head
    local char = game.Workspace:FindFirstChild(name)
    head.Position = char.Head.Position
    head.Orientation = char.Head.Orientation
    -- Torso
    torso.Position = char.Torso.Position
    torso.Orientation = char.Torso.Orientation
    -- Left Arm
    larm.Position = char("Left Arm").Position
    larm.Orientation = char("Left Arm").Orientation
    -- Right Arm
    rarm.Position = char("Right Arm").Position
    rarm.Orientation = char("Right Arm").Orientation
    -- Left Leg
    lleg.Position = char("Left Leg").Position
    lleg.Orientation = char("Left Leg").Orientation
    -- Right Leg
    rleg.Position = char("Right Leg").Position
    rleg.Orientation = char("Right Leg").Orientation
end

On line 62 it says "attempt to concatenate string with userdata". Help!!!

1 answer

Log in to vote
1
Answered by
Psudar 882 Moderation Voter
4 years ago

You're indexing char with () instead of [""], so change all the lines that do that with this syntax:

thing.Position = char["Body Part"].Position
Ad

Answer this question