I would like the bot to be able to clone someones character like the :char command.
2. Error
21:55:45.425 Character is not a valid member of Model “Workspace.wrlkoihbsdftsfdgsdfg” - Client - LocalScript:39
21:55:45.425 Stack Begin - Studio
21:55:45.426 Script ‘Players.cyberneticlogix.PlayerGui.Bot.MainFrame.LocalScript’, Line 39 - Studio - LocalScript:39
21:55:45.426 Stack End - Studio
Current code below
local mainpkg = script.Parent.Parent
local textlbls = mainpkg.MainFrame.TLS
local createbutton = mainpkg.MainFrame.BCreate
local value = mainpkg.Assets.BNum.Value
local LocalPlayer = game.Players.LocalPlayer
local BAnim = mainpkg.MainFrame.BAnim
local BCharacter = mainpkg.MainFrame.BCharacter
local BCreate = mainpkg.MainFrame.BCreate
local BName = mainpkg.MainFrame.BName
createbutton.MouseButton1Down:Connect(function()
if value ~= 1 then do
local dummy = mainpkg.Assets.Dummy:Clone()
dummy.Parent = game:GetService("Workspace")
dummy.Head.CFrame = LocalPlayer.Character.PrimaryPart.CFrame
-- Dummy Name Handler
BName:GetPropertyChangedSignal("Text"):Connect(function()
dummy.Name = BName.Text
end)
-- Character handler scraps from my admin commands
BCharacter:GetPropertyChangedSignal("Text"):Connect(function ()
local humanoiddescription = nil
local success, err = pcall(function()
humanoiddescription = game:GetService("Players"):GetHumanoidDescriptionFromUserId(game:GetService("Players"):GetUserIdFromNameAsync(BCharacter.Text))
end)
if humanoiddescription ~= nil then
if dummy.Character.Humanoid:FindFirstChild("HumanoidDescription") then
local pasthumanoiddescription = dummy.Character.Humanoid.HumanoidDescription
humanoiddescription.BodyTypeScale = pasthumanoiddescription.BodyTypeScale
humanoiddescription.DepthScale = pasthumanoiddescription.DepthScale
humanoiddescription.HeadScale = pasthumanoiddescription.HeadScale
humanoiddescription.HeightScale = pasthumanoiddescription.HeightScale
humanoiddescription.ProportionScale = pasthumanoiddescription.ProportionScale
humanoiddescription.WidthScale = pasthumanoiddescription.WidthScale
end
end
if success then
dummy.Character.Humanoid:ApplyDescription(humanoiddescription)
end
end)
value = value + 1
textlbls.TBot.Text = "Number of bots: 1/1"
end
elseif value == 1 then do
print("You already have a bot.")
textlbls.TBot.Text = "YOU ALREADY HAVE A BOT!"
wait(2)
textlbls.TBot.Text = "Number of bots: 1/1"
end
end
end)