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: Help With Changing Body Part Colors

Previous Thread :: Next Thread 
TheMcInc is online. TheMcInc
Joined: 30 Sep 2012
Total Posts: 227
28 Dec 2013 11:46 AM
Hi, I need help with a script im making, Im wondering how to change the color of an arm or leg. Here is the script:

--SCRIPT STARTS HERE
game.Players.PlayerAdded:connect(function(p)
p.Chatted:connect(function(msg)

if (msg == "Hi Mason!") then
c = BrickColor
player = p.Character

player.Torso.c = "Really blue"
player.Head.c = "Bright yellow"

--SCRIPT ENDS HERE

Anyone know how to set the color of the arms and legs.
I would like to set the right arm, right leg, left arm, and left leg colors individually. Im making the script as a prank for my friend. And yes, my name in real life is Mason.
Report Abuse
TheMcInc is online. TheMcInc
Joined: 30 Sep 2012
Total Posts: 227
28 Dec 2013 12:00 PM
[REFRESH]
Report Abuse
1cooldude361 is not online. 1cooldude361
Joined: 13 Mar 2010
Total Posts: 4403
28 Dec 2013 12:04 PM
Well, either I'm just uninformed on variables, but I didn't think you could just set a property to a variable.

player.Torso.BrickColor = BrickColor.new("Really blue") would work. I'm not sure if you've already tested the script o3o

Anyway, the arms and legs... player["Right Arm"].BrickColor

Just change Right Arm to Left Arm, Left Leg, or Right Leg based on which one you're editing.

Outfoxing Foxes
Report Abuse
TheMcInc is online. TheMcInc
Joined: 30 Sep 2012
Total Posts: 227
28 Dec 2013 12:06 PM
Thanks A lot!
Report Abuse
TheMcInc is online. TheMcInc
Joined: 30 Sep 2012
Total Posts: 227
28 Dec 2013 12:27 PM
@1CoolDude

I did some more stuff to the script and now its kinda messed up a bit im having quite a few errors where I have no idea how they happen...






game.Players.PlayerAdded:connect(function(p)
p.Chatted:connect(function(msg)
-- msg = msg:lower()
if (msg == "reset") then
if (p.Character ~= nil) then
p.Character.Humanoid.Health = 0
end

elseif (msg == "noob") then

player = p.Character

player.Torso.BrickColor = "Really blue"
player.Head.BrickColor = "Bright yellow"
player["Right Arm"].BrickColor = "Bright yellow"
player["Left Arm"].BrickColor = "Bright yellow"
player["Right Leg"].BrickColor = "Camo"
player["Left Leg"].BrickColor = "Camo"
end


elseif (msg == "Can I have a pet?") then

if (p.Character ~= nil) then
p.Character.Humanoid.Health = 0
end

end
-- If you run out, just copy and paste more of the line 'elseif (msg == "") then'
end)
end)
Report Abuse
1cooldude361 is not online. 1cooldude361
Joined: 13 Mar 2010
Total Posts: 4403
28 Dec 2013 12:31 PM
Change all the 'BrickColor = "Bright yellow"' and 'BrickColor = "Camo"' things to

BrickColor = BrickColor.new("Bright yellow")
BrickColor = BrickColor.new("Camo")

Colors are weird, but that's how you set their value.


Outfoxing Foxes
Report Abuse
TheMcInc is online. TheMcInc
Joined: 30 Sep 2012
Total Posts: 227
28 Dec 2013 12:35 PM
That still didn't fix the problems I'm having.
The spot where its says there's an error is:

elseif (msg == "Can I have a pet?") then

the code from that part of the script down is:

elseif (msg == "Can I have a pet?") then

if (p.Character ~= nil) then
p.Character.Humanoid.Health = 0
end

end
-- If you run out, just copy and paste more of the line 'elseif (msg == "") then'
end)
end)

Can u help with this at all?
Report Abuse
TheMcInc is online. TheMcInc
Joined: 30 Sep 2012
Total Posts: 227
28 Dec 2013 12:44 PM
[REFRESH]
[MESSAGE] 38 People have read this thread, and I have only had 6 replies, is anyone going to help?
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
28 Dec 2013 12:47 PM
Ok change all the letters in:can I have a pet
To lowercase..probly..because of this line I belive..
msg=msg:lower ()
Report Abuse
TheMcInc is online. TheMcInc
Joined: 30 Sep 2012
Total Posts: 227
28 Dec 2013 12:52 PM
-I did that and removed the question mark, but there is still an error on that line, the error description when I mouse over the red underlining gives:

'end' expected (to close 'function' at line 14) near 'elseif'

-Line 14 looks like this:

p.Chatted:connect(function(msg)
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
28 Dec 2013 12:54 PM
Aha!!
Aha!!
Add another end, and your script should worl
Report Abuse
TheMcInc is online. TheMcInc
Joined: 30 Sep 2012
Total Posts: 227
28 Dec 2013 12:55 PM
Where would I add the end at? what line, and if indenting is needed, how many times should I press my 'tab' key?
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
28 Dec 2013 12:59 PM
Hm..well just add aj end near the other ends..if it doesn't work..then try other places where ends could be.. I'd try myselr..but..I'm using phone atm so..can't try it myself. .
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
28 Dec 2013 12:59 PM
But anyway..problem is..it needs another end
Report Abuse
TheMcInc is online. TheMcInc
Joined: 30 Sep 2012
Total Posts: 227
28 Dec 2013 01:02 PM
There isn't really any places where I can add the end at, I'm going to put the script below for you to look at:

game.Players.PlayerAdded:connect(function(p)
p.Chatted:connect(function(msg)
-- msg = msg:lower()
if (msg == "reset") then
if (p.Character ~= nil) then
p.Character.Humanoid.Health = 0
end

elseif (msg == "noob") then

player = p.Character

player.Torso.BrickColor = BrickColor.new("Really blue")
player.Head.BrickColor = BrickColor.new("Bright yellow")
player["Right Arm"].BrickColor = BrickColor.new("Bright yellow")
player["Left Arm"].BrickColor = BrickColor.new("Bright yellow")
player["Right Leg"].BrickColor = BrickColor.new("Camo")
player["Left Leg"].BrickColor = BrickColor.new("Camo")
end


elseif (msg == "can I have a pet") then

if (p.Character ~= nil) then
p.Character.Humanoid.Health = 0
end
end
-- If you run out, just copy and paste more of the line 'elseif (msg == "") then'
end)
end)
Report Abuse
TheMcInc is online. TheMcInc
Joined: 30 Sep 2012
Total Posts: 227
28 Dec 2013 01:06 PM
[REFRESH]
Report Abuse
TheMcInc is online. TheMcInc
Joined: 30 Sep 2012
Total Posts: 227
28 Dec 2013 01:11 PM
HELLO??? ANY1 GOING TO HELP ME OUT A BIT?
Report Abuse
Smiley5991 is not online. Smiley5991
Joined: 15 Sep 2009
Total Posts: 259
28 Dec 2013 01:14 PM
game.Players.PlayerAdded:connect(function(p)
p.Chatted:connect(function(msg)
if (msg == "reset") then
p.Character.Humanoid.Health = 0
elseif (msg == "noob") then
player = p.Character
player.Torso.BrickColor = BrickColor.new("Really blue")
player.Head.BrickColor = BrickColor.new("Bright yellow")
player["Right Arm"].BrickColor = BrickColor.new("Bright yellow")
player["Left Arm"].BrickColor = BrickColor.new("Bright yellow")
player["Right Leg"].BrickColor = BrickColor.new("Camo")
player["Left Leg"].BrickColor = BrickColor.new("Camo")
end
end)
end)

That should work.
Report Abuse
TheMcInc is online. TheMcInc
Joined: 30 Sep 2012
Total Posts: 227
28 Dec 2013 01:29 PM
What indents would you put in, could you put the code on pastebin.com and give me the link, that way I can see the code with the indents?
Report Abuse
TheMcInc is online. TheMcInc
Joined: 30 Sep 2012
Total Posts: 227
28 Dec 2013 01:35 PM
[REFRESH]
[MESSAGE] Im bumping this
Report Abuse
1cooldude361 is not online. 1cooldude361
Joined: 13 Mar 2010
Total Posts: 4403
28 Dec 2013 04:43 PM
You don't need indents...

Outfoxing Foxes
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
28 Dec 2013 04:44 PM
Can you sum up your problem up until this point, so we don't have to read all your posts?
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
28 Dec 2013 05:43 PM
game.Players.PlayerAdded:connect(function(p)
p.Chatted:connect(function(msg)

if (msg == "Hi Mason!") then
c = BrickColor
player = p.Character

player.Torso.c = BrickColor.new("Really blue")
player.Head.c = BrickColor.new("Bright yellow")
end end) end)
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
28 Dec 2013 06:15 PM
(ima genius)
this has no errors now :D

game.Players.PlayerAdded:connect(function(p)
p.Chatted:connect (function(msg)
msg = msg:lower()
if (msg == "reset") then
if (p.Character ~= nil) then
p.Character.Humanoid.Health = 0
end


elseif (msg == "noob") then

player = p.Character

player.Torso.BrickColor = BrickColor.new("Really blue")
player.Head.BrickColor = BrickColor.new("Bright yellow")
player["Right Arm"].BrickColor = BrickColor.new("Bright yellow")
player["Left Arm"].BrickColor = BrickColor.new("Bright yellow")
player["Right Leg"].BrickColor = BrickColor.new("Camo")
player["Left Leg"].BrickColor = BrickColor.new("Camo")
end
end)
end)

if msg == "can I have a pet" then

if p.Character ~= nil then
p.Character.Humanoid.Health = 0
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