|
| 24 Jun 2014 06:42 PM |
| I successfully changed by body colour when I entered but for some reason it returns to its normal colour after about a minute. Help please? |
|
|
| Report Abuse |
|
|
domorox17
|
  |
| Joined: 06 Mar 2012 |
| Total Posts: 1710 |
|
|
| 24 Jun 2014 06:45 PM |
| You have to alter the BodyColors object in their character every time they respawn using the CharacterAdded event. |
|
|
| Report Abuse |
|
|
|
| 24 Jun 2014 06:49 PM |
OK I got it working using loops but it's only changing the torso's color.
Player=script.Parent.Parent.Parent.Parent.Parent.Character GUI=script.Parent.Parent script.Parent.MouseButton1Down:connect(function() for _,v in pairs(script.Parent.Parent:GetChildren()) do v.Visible=false GUI.Visible=false for _,v in pairs(Player:GetChildren()) do if v.Name=="Torso" or v.Name=="Left Leg" or v.Name=="Right Leg" or v.Name=="Right Arm" or v.Name=="Left Arm" then if GUI.Blue.Visible==true then v.BrickColor=BrickColor.new("Bright blue") while wait(30) do v.BrickColor=BrickColor.new("Bright blue") end elseif GUI.Red.Visible==true then v.BrickColor=BrickColor.new("Bright red") while wait(30) do v.BrickColor=BrickColor.new("Bright red") end elseif GUI.Green.Visible==true then v.BrickColor=BrickColor.new("Bright green") while wait(30) do v.BrickColor=BrickColor.new("Bright green") end elseif GUI.White.Visible==true then v.BrickColor=BrickColor.new("White") while wait(30) do v.BrickColor=BrickColor.new("White") end end end end end end) |
|
|
| Report Abuse |
|
|
|
| 24 Jun 2014 06:49 PM |
Here's a script that saves a player's body colour, and when they enter it, it gets loaded and applied.
---------------------- -- cSave 1.0 -- -- By Electrodacity -- ----------------------
default_bcolour = "White" -- Change to your liking
game.Players.PlayerAdded:connect(function(player) local sData = nil if player.WaitForDataReady then if(player:LoadString("DEF_COLOUR_BACKGROUND") == nil) then player:SaveString("DEF_COLOUR_BACKGROUND",default_bcolour) end sData = player:LoadString("DEF_COLOUR_BACKGROUND") end for i,v in ipairs(player.Character:children()) do if v.BrickColor then v.BrickColor = BrickColor.new(sData) end end end))
game.Players.PlayerLeaving:connect(function(player) if player.Character then player:SaveString("DEF_COLOUR_BACKGROUND",player.Character.Head.BrickColor) end end)) |
|
|
| Report Abuse |
|
|