blockoo
|
  |
| Joined: 08 Nov 2007 |
| Total Posts: 17202 |
|
|
| 13 Aug 2011 07:30 PM |
I obviously cannot see the output because it is a PlayerEnetered event...I have no idea what's wrong D:
game.Players.PlayerAdded:connect(function(newPlayer) coroutine.resume(coroutine.create(function() repeat wait() until newPlayer.Character wait(3) for m, n in pairs(newPlayer.Character:GetChildren()) do if (n.ClassName == "Tool") then n:Remove() end end storage = Instance.new("Model") storage.Parent = game.Lighting storage.Name = newPlayer.Name.."Gear" cln = game.Lighting.Checker:Clone() cln.Parent = game.Workspace cln.AssignedPlayer.Value = newPlayer cln.AssignedModel.Value = storage for i, v in pairs(newPlayer.Backpack:GetChildren()) do for x, y in pairs(newPlayer.StarterGear:GetChildren()) do if (v.Name == y.Name) then v:Remove() end y:Clone().Parent = storage y:Remove() end end c = game.Lighting.GearRemover:Clone() c.Parent = game.Workspace c.Assigned.Value = newPlayer end)) end) |
|
|
| Report Abuse |
|
|
swmaniac
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
|
| 13 Aug 2011 07:32 PM |
coroutines?
game:GetService("Players").PlayerAdded:connect(function(newPlayer) while not newPlayer:FindFirstChild("StarterGear") do wait() end for _, v in pairs(newPlayer.StarterGear:GetChildren()) do v:remove() end end)
To my knowledge, that would work just as well. |
|
|
| Report Abuse |
|
|
blockoo
|
  |
| Joined: 08 Nov 2007 |
| Total Posts: 17202 |
|
|
| 13 Aug 2011 07:34 PM |
| I was getting errors with the PlayerAdded event because so many people were entering at once, so someone told me to use coroutines P: |
|
|
| Report Abuse |
|
|
swmaniac
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
|
| 13 Aug 2011 07:35 PM |
| I have... never had that happen to me. I think you're OK not using coroutines on this. |
|
|
| Report Abuse |
|
|
blockoo
|
  |
| Joined: 08 Nov 2007 |
| Total Posts: 17202 |
|
|
| 13 Aug 2011 07:41 PM |
| It wasn't working before I put them in, but after I did it worked. |
|
|
| Report Abuse |
|
|
blockoo
|
  |
| Joined: 08 Nov 2007 |
| Total Posts: 17202 |
|
| |
|
blockoo
|
  |
| Joined: 08 Nov 2007 |
| Total Posts: 17202 |
|
| |
|
| |
|
blockoo
|
  |
| Joined: 08 Nov 2007 |
| Total Posts: 17202 |
|
|
| 13 Aug 2011 08:03 PM |
| I don't think I need to...this coroutine script worked before, then I changed it and it stopped |
|
|
| Report Abuse |
|
|
|
| 13 Aug 2011 08:17 PM |
| start a local server, enter a player, and look at the output then |
|
|
| Report Abuse |
|
|