I am trying to create a “statue” around the avatar when they touch an object. I got it to make the statue y cloning it from Replicatedstorage using the following:
local statueClone = statue:Clone()
statueClone.Parent = game.Workspace
statueClone.rootPart.CFrame = CFrame.new(humanoid:FindFirstChild('HumanoidRootPart').Position)
Once the statue is created, though, I get the error
ServerScriptService.StatueScript:68: attempt to index nil with 'Position'
I tried using statueClone.Position = humanoid:FindFirstChild('HumanoidRootPart').Position instead, but it gives the same problem
PS- Statueclone is a model which consists of three parts, of which one is called rootPart.
The statue is supposed to be destroyed a few seconds later, but it never reaches this step, presumably due to the above error.