Just a quick one, I'm trying to make a model follow the mouse or go to the mouse' location. I've stuck it in a while look just while I'm testing it but all I'm getting is this error;
20:30:08.985 - Workspace.Rock.Rock.Script:7: attempt to call method 'SetPrimaryPartCFrame' (a nil value)
The script below is literally only for testing purposes it's not the final product, but I can't quite work out what is wrong.
while true do
wait()
player = game.Players:FindFirstChild("Player1")
mouse = player:GetMouse()
parts = script.Parent:GetChildren()
parts.PrimaryPart = parts.Rock
parts:SetPrimaryPartCFrame(CFrame.new(mouse.Hit.p.X,mouse.Hit.p.Y,mouse.Hit.p.Z)* CFrame.Angles(0, 0, 0))
end
