LeikaZ
|
  |
| Joined: 31 Jan 2008 |
| Total Posts: 595 |
|
|
| 14 Feb 2016 01:20 PM |
Why doesn't it work? Output doesn't show any errors.
local Players = game:GetService("Players")
function onPlayerAdded(player) repeat wait() until player.Character player.Character.Head.BrickColor = BrickColor.new("Pastel brown") player.Character.Torso.BrickColor = BrickColor.new("Pastel brown") player.Character:FindFirstChild("Right Arm").BrickColor = BrickColor.new("Pastel brown") player.Character:FindFirstChild("Left Arm").BrickColor = BrickColor.new("Pastel brown") player.Character:FindFirstChild("Left Leg").BrickColor = BrickColor.new("Pastel brown") player.Character:FindFirstChild("Right Leg").BrickColor = BrickColor.new("Pastel brown") Players.PlayerAdded:connect(onPlayerAdded)
|
|
|
| Report Abuse |
|
|
LeikaZ
|
  |
| Joined: 31 Jan 2008 |
| Total Posts: 595 |
|
|
| 14 Feb 2016 01:21 PM |
Is there any other way to change body colors?
|
|
|
| Report Abuse |
|
|
|
| 14 Feb 2016 01:26 PM |
game.Players.PlayerAdded:connect(function(plyr) plyr.CharactedAdded:connect(function() for _, v in pairs(plyr.Character:GetChildren()) do if v:IsA('Part') then v.BrickColor = BrickColor.new('Pastel Brown') end end end) end)
|
|
|
| Report Abuse |
|
|
LeikaZ
|
  |
| Joined: 31 Jan 2008 |
| Total Posts: 595 |
|
|
| 14 Feb 2016 01:38 PM |
@cheesecake CharactedAdded is not a valid member of Player
|
|
|
| Report Abuse |
|
|
|
| 14 Feb 2016 01:41 PM |
What the heck is CharactedAdded?
I'd go with
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(char) coroutine.resume(coroutine.create(function() wait(0.5) for i,v in pairs(char:GetChildren()) do if v:IsA("BasePart") then v.BrickColor = BrickColor.new("Pastel brown") end end end)) end) end)
-____________________________- |
|
|
| Report Abuse |
|
|
LeikaZ
|
  |
| Joined: 31 Jan 2008 |
| Total Posts: 595 |
|
| |
|
LeikaZ
|
  |
| Joined: 31 Jan 2008 |
| Total Posts: 595 |
|
|
| 14 Feb 2016 01:44 PM |
I don't know why, but my body colors doesn't change when I use both scripts
|
|
|
| Report Abuse |
|
|
|
| 14 Feb 2016 01:44 PM |
Also, cheesecake, you should read up on what functions return. You use
plyr.Character
in your for loop, while you could just do
plyr.CharacterAdded:connect(function(char) for i,v in pairs(char:GetChildren())
-____________________________- |
|
|
| Report Abuse |
|
|
LeikaZ
|
  |
| Joined: 31 Jan 2008 |
| Total Posts: 595 |
|
|
| 14 Feb 2016 01:45 PM |
Forgot to mention: no errors. :/
|
|
|
| Report Abuse |
|
|
|
| 14 Feb 2016 01:45 PM |
Are you using a serverside script? Is FilteringEnabled on? If your on a localscript are you running in a client?
-____________________________- |
|
|
| Report Abuse |
|
|
LeikaZ
|
  |
| Joined: 31 Jan 2008 |
| Total Posts: 595 |
|
|
| 14 Feb 2016 01:48 PM |
Script - Not local (serverside) I guess FE - Off
I use studio's "Play" mode
|
|
|
| Report Abuse |
|
|
|
| 14 Feb 2016 01:49 PM |
Does it work in game?
-____________________________- |
|
|
| Report Abuse |
|
|
LeikaZ
|
  |
| Joined: 31 Jan 2008 |
| Total Posts: 595 |
|
|
| 14 Feb 2016 01:51 PM |
so apparently it doesn't work in "Play Solo"
Thanks.
|
|
|
| Report Abuse |
|
|
|
| 14 Feb 2016 01:58 PM |
Fixed it. The Body Colors Instance was overwriting changes made the characters body color, as the changes were made before it was added to the character. This should work now.
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(char) local bodyColors = char:WaitForChild("Body Colors") bodyColors.Parent = nil for i,v in pairs(char:GetChildren()) do if v:IsA("BasePart") and v.Name ~= "HumanoidRootPart" then v.BrickColor = BrickColor.new("Pastel brown") print(v.Name) end end end) end)
That should work now.
-____________________________-
-____________________________- |
|
|
| Report Abuse |
|
|