0rka
|
  |
| Joined: 26 Dec 2013 |
| Total Posts: 1070 |
|
|
| 22 Feb 2014 12:27 PM |
function iterate(item) for i,v in pairs(item:GetChildren()) do if v:IsA("ShirtGraphic") or (v.Name == "roblox" and v:IsA("Decal")) then v:Remove() else local grandChildren = v:GetChildren() if #grandChildren > 0 then iterate(v) end end end end
game.Players.PlayerAdded:connect(function(plr) for i,v in pairs(plr.Character:GetChildren()) do if v:IsA("Hat") then v:Remove() elseif v:IsA("Shirt") then v.ShirtTemplate = "http://www.roblox.com/asset/?id=142329377" elseif v:IsA("Pants") then v.PantsTemplate = "http://www.roblox.com/asset/?id=142329390" end end iterate(plr) plr.Character:FindFirstChild("Shirt Graphic", true):Remove() end)
-- this gives me no errors in build mode. |
|
|
| Report Abuse |
|
|
yankeejr
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 4906 |
|
| |
|
|
| 22 Feb 2014 01:02 PM |
| ur trying to get character rite after player appears tats y |
|
|
| Report Abuse |
|
|
|
| 22 Feb 2014 01:12 PM |
--you're trying to access the character before it loads, two solutions:
game.Players.PlayerAdded:connect(function(plr) plr:WaitForDataReady() CODING HERE end)
OR
game.Players.PlayerAdded:connect(function(plr) repeat wait() until plr.Character CODING HERE end) |
|
|
| Report Abuse |
|
|
|
| 22 Feb 2014 01:46 PM |
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(char) --code end) end)
#nerdsunited |
|
|
| Report Abuse |
|
|
0rka
|
  |
| Joined: 26 Dec 2013 |
| Total Posts: 1070 |
|
|
| 23 Feb 2014 07:40 PM |
| I tried it with plr:WaitForDataReady() before and it didn't seem to work either. |
|
|
| Report Abuse |
|
|
|
| 23 Feb 2014 07:41 PM |
| You could also try plr.CharacterAdded:wait() if you wanted... |
|
|
| Report Abuse |
|
|