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

Item wont move it to mouse position? given error CFrame is not a valid member of Model

Asked by 7 years ago
Edited 7 years ago

So i've been working on a test to move items where you mouse is

local player = game.Players.LocalPlayer
local character = script.Parent.Parent.Name
local mouse = player:GetMouse()
local item = 'Bed'


mouse.Button1Down:connect(function()
    game.ReplicatedStorage[item]:Clone().Parent = game.Workspace[character]
    for i,v in pairs(game.Workspace[character][item]:GetChildren()) do
                v.CFrame=CFrame.new(mouse.Target.Position.x, mouse.Target.Position.y, mouse.Target.Position.z)
        end
end)

gives error

CFrame is not a valid member of Model and its not suppost to look and move the model but instead the parts

0
Models don't have CFrames. Parts do. Kampfkarren 215 — 7y
0
Also, you don't need to do [""..character], you can just do [character]. Kampfkarren 215 — 7y
0
Oh and it looks for parts not model GimmeWaffleBruh 18 — 7y
0
You can make the model as a union and use it as like if it was a model. Unions have CFrames. Afraid4Life 5 — 7y

Answer this question