#My character isnt cloning

1 messages · Page 1 of 1 (latest)

solar crow
#

I do not know why, but whenever I try to run char:Clone() it gives me an error like it doesnt clone I do not know why can someone debug it for me? Heres the local script: ```local Btn = game.Workspace:WaitForChild("Button"):WaitForChild("MeshBtn")
local SoundEffect = game:GetService("SoundService"):WaitForChild("Audio/Roblox_Pinball_Giant_Button_Press_05")
local AdvancePathFindingScript = game.ReplicatedStorage:WaitForChild("AdvancedPathFinding")
local Animate = game.ReplicatedStorage:WaitForChild("Animate")
local debounce = false
local RemoteEvent = game.ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("NpcClone")

Btn.Touched:Connect(function(hit)
if debounce then
return
end

debounce = true
Btn.Color = Color3.fromRGB(0, 255, 0)

if RemoteEvent then
    RemoteEvent:FireServer()
else
    warn("RemoteEvent 'NpcClone' not found!")
end

SoundEffect:Play()

task.wait(1)
debounce = false
Btn.Color = Color3.fromRGB(255, 0, 4)

end)

#

and heres the server script: ``` local RemoteEvent = game.ReplicatedStorage.Remotes.NpcClone
local Btn = game.Workspace.Button.MeshBtn
local Animate = game.ReplicatedStorage:WaitForChild("Animate")
local AdvancedPathFinding = game.ReplicatedStorage:WaitForChild("AdvancedPathFinding")

RemoteEvent.OnServerEvent:Connect(function(plr)
local char = plr.Character or plr.CharacterAdded:Wait()
local humanoidRootPart = char:WaitForChild("HumanoidRootPart")

local newChar = char:Clone()

if newChar then
    newChar.Name = "Rig"
    newChar.Parent = workspace

    local newHRP = newChar:WaitForChild("HumanoidRootPart")

    if newHRP then
        newHRP.CFrame = Btn.CFrame + Vector3.new(0, 5, 0)
    else
        warn("HumanoidRootPart not found in cloned character!")
        return
    end

    Animate:Clone().Parent = newChar
    AdvancedPathFinding:Clone().Parent = newChar
else
    print("Did not clone character!")
end

end)

earnest viper
#

What’s the error

#

And what line

neon adder