grunt1994
|
  |
| Joined: 04 Oct 2008 |
| Total Posts: 1201 |
|
|
| 03 Jul 2016 11:37 AM |
I've made this script so that when you spawn into the game it removes body meshes, clothes and changes your body colour... I literally just threw it together in a min or so but it doesn't work (Suprise, suprise) Just wondering if anyone can throw a quick fix my way incase i'm missing something i did wrong. Thanks
function onSpawn(Char) print("Starting") if game.Players:FindFirstChild(Char.Name)~=nil and Char:FindFirstChild("Humanoid")~=nil then local pl = Char:GetChildren() for i= 1, #pl do if pl:IsA("CharacterMesh") and pl:IsA("Shirt") and pl:IsA("Pants") then pl:remove() end wait() local col = Char:FindFirstChild("Body Colors") col.TorsoColor = BrickColor.new(math.random("Bright Red","Bright Blue","Bright Green","Bright Yellow")) col.LeftLegColor = BrickColor.new("Black") col.RightLegColor = BrickColor.new("Black") end end print("Done") end
game.Workspace.ChildAdded:connect(onSpawn)
|
|
|
| Report Abuse |
|
|
Mkoalko
|
  |
| Joined: 26 Dec 2011 |
| Total Posts: 186 |
|
|
| 03 Jul 2016 11:39 AM |
if pl:IsA("CharacterMesh") and pl:IsA("Shirt") and pl:IsA("Pants") then
switch the ands for or |
|
|
| Report Abuse |
|
|
Place_2
|
  |
| Joined: 01 Jun 2016 |
| Total Posts: 2541 |
|
|
| 03 Jul 2016 11:41 AM |
function onSpawn(Char) print("Starting")
if game.Players:FindFirstChild(Char.Name)~=nil and Char:FindFirstChild("Humanoid")~=nil then local pl = Char:GetChildren() for i,v in pairs(pl) do if v:IsA("CharacterMesh") or v:IsA("Shirt") or v:IsA("Pants") then pl:remove() else print(v.Name.." is neither of these") end wait() local col = Char:FindFirstChild("Body Colors") col.TorsoColor = BrickColor.new(math.random("Bright Red","Bright Blue","Bright Green","Bright Yellow")) col.LeftLegColor = BrickColor.new("Black") col.RightLegColor = BrickColor.new("Black") end end print("Done") end
game.Workspace.ChildAdded:connect(onSpawn)
haven't looked at anything below 'local col'
but your first problem is your function removes anything that is a shirt AND pants AND mesh |
|
|
| Report Abuse |
|
|
|
| 03 Jul 2016 12:54 PM |
| Cant you just disable that Character Load Appearance thing in Lighting? |
|
|
| Report Abuse |
|
|
BanTech
|
  |
| Joined: 31 Dec 2015 |
| Total Posts: 886 |
|
|
| 03 Jul 2016 01:02 PM |
^ it's not in Lighting
http://wiki.roblox.com/index.php?title=API:Class/StarterPlayer/LoadCharacterAppearance |
|
|
| Report Abuse |
|
|
| |
|