Cloned model but it says it's remote event

local player = game.Players:FindFirstChild(script.Parent.Parent.Name)
local newbody = Instance.new("RemoteEvent", ReplicateStorage)
newbody.Name = "nomnomNewbody"

newbody.OnServerEvent:Connect(function(user)
    if user.Name == player.Name then
        local newBody = script.nomnomyee:Clone()
        newbody.Parent = game.Workspace
        newbody.Name = "Char"
        newbody.HumanoidRootPart.Position = Vector3.new(0, 0, 0)
    else
        user:Kick("remote is wrong")
    end
end)

and I got this error : HumanoidRootPart is not member of Remote event “workspace.Char”
script is server sided

also nomnomyee is model that is inside of script

you have 2 variables, newBody and newbody, you mixed those two up in

if user.Name == player.Name then
    local newBody = script.nomnomyee:Clone()
    newbody.Parent = game.Workspace
    newbody.Name = "Char"
    newbody.HumanoidRootPart.Position = Vector3.new(0, 0, 0)
else

it should instead be

if user.Name == player.Name then
    local newBody = script.nomnomyee:Clone()
    newBody.Parent = game.Workspace
    newBody.Name = "Char"
    newBody.HumanoidRootPart.Position = Vector3.new(0, 0, 0)
else
1 Like