generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Gear Removal Script not working D:

Previous Thread :: Next Thread 
blockoo is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. blockoo
Joined: 08 Nov 2007
Total Posts: 17202
13 Aug 2011 07:54 PM
>.>
Report Abuse
blockoo is not online. blockoo
Joined: 08 Nov 2007
Total Posts: 17202
13 Aug 2011 08:01 PM
Y U NO POST?
Report Abuse
JoshJosh117 is not online. JoshJosh117
Joined: 22 Jul 2007
Total Posts: 4862
13 Aug 2011 08:02 PM
did you even try his code
Report Abuse
blockoo is not online. 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
JoshJosh117 is not online. JoshJosh117
Joined: 22 Jul 2007
Total Posts: 4862
13 Aug 2011 08:17 PM
start a local server, enter a player, and look at the output then
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image