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

It says X is not a valid member of part? Please help.

Asked by
ZITOI 0
8 years ago
local Brick = Instance.new("Part")
Brick.Parent = game.Workspace
while true do
Brick.Position.X = game.Workspace.Player.Torso.X
Brick.Position.Y = game.Workspace.Player.Torso.Y
Brick.Position.Z = game.Workspace.Player.Torso.Z
0
Unless X, Y and Z are instances, it would be Torso.Position.X instead of Torso.X FearMeIAmLag 1161 — 8y
0
oh thank you!! ZITOI 0 — 8y

1 answer

Log in to vote
2
Answered by
davness 376 Moderation Voter
8 years ago

You cannot edit values of Position. You can just edit Position itself. And you forgot to say thatTorso.Position.Xand not Torso.X

local Brick = Instance.new("Part")
Brick.Parent = game.Workspace
while true do
Brick.Position = game.Workspace.Player.Torso.Position -- you forgot to say Position. X = X, Y = Y, Z = Z

As spongocard said, it wont work if you dont put an endand an wait():

local Brick = Instance.new("Part")
Brick.Parent = game.Workspace
while true do
    Brick.Position = game.Workspace.Player.Torso.Position -- you forgot to say Position. X = X, Y = Y, Z = Z
    wait()
end
0
YAY thanks everybody ZITOI 0 — 8y
0
if helped please accept the answer. thanks davness 376 — 8y
2
Firstly, you need an end in your code for the while loop. Second, you need a wait in your while loop, otherwise it will crash. Spongocardo 1991 — 8y
0
it passed to me. i will change that davness 376 — 8y
Ad

Answer this question