So I have the script that clones the backpacks to lighting.
game.Players.PlayerAdded:connect(function(p)
local back = Instance.new("Backpack", game.Lighting)
back.Name = p.Name
local c = Instance.new("Backpack", back)
c.Name = "CurrentCharacter"
lcoal s = game.ServerScriptService.Character:Clone()
s.Parent = back
s.Disabled = false
end)
`
That works perfectly. Now in the script called Character there is this.
s = script.Parent.CurrentCharacter:FindFirstChild("CreateCharacter")
game.Players.PlayerAdded:connect(function(p)
p.CharacterAdded:connect(function(c)
check = p:WaitForChild("Backpack")
if check:FindFirstChild("CreateCharacter") then
check.CreateCharacter:Destroy()
repeat wait() until check.CreateCharacter == nil
end
if s ~= nil then
local ch = s:Clone()
ch.Parent = check
ch.Disabled = false
end
end)
end)
This doesn't function as I wanted it to. It's suppose to do this:
- Check if in the player's backpack check if there is a script called "CreateCharacter"
- If that ~=nil then, Destroy() it.
- Once that's done, clone a new one.
- If CreateCharacter was nil then, skip to cloning a new one.
- The createcharacter will be cloned to the player's backpack, and set disabled to false.
I have no idea what's wrong..

2 comments
You cannot create "Backpack" it is not an instance.
Actually you can. You can try.