Tynexx
|
  |
| Joined: 11 Jul 2012 |
| Total Posts: 1559 |
|
|
| 18 Jun 2014 07:03 PM |
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:
1. Check if in the player's backpack check if there is a script called "CreateCharacter" 2. If that ~=nil then, Destroy() it. 3. Once that's done, clone a new one. 4. If CreateCharacter was nil then, skip to cloning a new one. 5. The createcharacter will be cloned to the player's backpack, and set disabled to false.
I have no idea what's wrong.. |
|
|
| Report Abuse |
|
|
Tynexx
|
  |
| Joined: 11 Jul 2012 |
| Total Posts: 1559 |
|
| |
|
|
| 18 Jun 2014 07:46 PM |
lcoal s = game.ServerScriptService.Character:Clone()
lcoal
LCOAL
LCOALL?!?!? |
|
|
| Report Abuse |
|
|
Tynexx
|
  |
| Joined: 11 Jul 2012 |
| Total Posts: 1559 |
|
| |
|
| |
|
Tynexx
|
  |
| Joined: 11 Jul 2012 |
| Total Posts: 1559 |
|
| |
|
| |
|
Tynexx
|
  |
| Joined: 11 Jul 2012 |
| Total Posts: 1559 |
|
| |
|
| |
|
Tynexx
|
  |
| Joined: 11 Jul 2012 |
| Total Posts: 1559 |
|
| |
|
| |
|
Tynexx
|
  |
| Joined: 11 Jul 2012 |
| Total Posts: 1559 |
|
|
| 18 Jun 2014 07:53 PM |
| Do you know when to use local. |
|
|
| Report Abuse |
|
|
|
| 18 Jun 2014 07:56 PM |
| How do you even disable S? |
|
|
| Report Abuse |
|
|
Tynexx
|
  |
| Joined: 11 Jul 2012 |
| Total Posts: 1559 |
|
| |
|
Tynexx
|
  |
| Joined: 11 Jul 2012 |
| Total Posts: 1559 |
|
| |
|
Tynexx
|
  |
| Joined: 11 Jul 2012 |
| Total Posts: 1559 |
|
| |
|
| |
|
Tynexx
|
  |
| Joined: 11 Jul 2012 |
| Total Posts: 1559 |
|
| |
|
Tynexx
|
  |
| Joined: 11 Jul 2012 |
| Total Posts: 1559 |
|
| |
|