In this script, I am trying to spawn a brick on the HumanoidRootParts cframe, facing the same direction as the player. However, the issue is that I get the error message of " Cframe is not a valid member of Part “Workspace.snipperdiaper.HumanoidRootPart”
So far i’ve messed with the script for about 30 minutes trying to see what was wrong with it, but I havent gotten anywhere
The script:
local tool = script.Parent
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
if not character or not character.Parent then
character = player.CharacterAdded:wait()
end
tool.Activated:Connect(function()
local part = game.Workspace:FindFirstChild("BariWall")
local ClonedPart = part:Clone()
ClonedPart.Parent = workspace
ClonedPart.Position = humanoidRootPart.Cframe.New(humanoidRootPart)
end)
The line in question:
ClonedPart.Position = humanoidRootPart.Cframe.New(humanoidRootPart)
Any help or guidance is appreciated