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: Changing body colours help

Previous Thread :: Next Thread 
ACDevelopersAccount is not online. ACDevelopersAccount
Joined: 23 Jun 2014
Total Posts: 47
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 is not online. 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
ACDevelopersAccount is not online. ACDevelopersAccount
Joined: 23 Jun 2014
Total Posts: 47
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
Electrodacity is not online. Electrodacity
Joined: 07 Apr 2014
Total Posts: 225
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
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