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 » Scripters
Home Search
 

Re: What script would I use to make a brick change color?

Previous Thread :: Next Thread 
SkittleHacker is not online. SkittleHacker
Joined: 28 Jan 2015
Total Posts: 11
05 Aug 2016 05:38 PM
Okay, i'm making a tycoon atm and im not really a scripter and so I need help with certain things. Right now im trying to get a brick to change color when the owner of the tycoon stands on it and change back to the original color after he steps off. can anybody help me?
Report Abuse
crate109 is not online. crate109
Joined: 24 Nov 2010
Total Posts: 315
05 Aug 2016 06:34 PM
function onPlayerHitButton(hit)
if hit.Parent then
if hit.Parent:FindFirstChild("Humanoid") then
script.Parent.Color = BrickColor.new("Green")
end
end
end

script.Parent.Touched:connect(onPlayerHitButton)

function onHitEnded()
script.Parent.Color = BrickColor.new("Red")
end

script.Parent.Touchended:connect(onHitEnded)


-- And put all of these lines in a script that will be inside the part you want to change color (the brick)
Report Abuse
crate109 is not online. crate109
Joined: 24 Nov 2010
Total Posts: 315
05 Aug 2016 06:34 PM
TouchEnded * Watchout for the syntax
Report Abuse
Skellobit is not online. Skellobit
Joined: 13 Apr 2016
Total Posts: 12758
05 Aug 2016 06:35 PM
umm watch out for the property errors and the incorrect BrickColor names

Formerly ToxicDominator - add 17,509 posts
Report Abuse
pidgey is not online. pidgey
Joined: 16 Jan 2008
Total Posts: 2739
05 Aug 2016 06:48 PM
u cant go wrong with enum


https://www.roblox.com/My/Groups.aspx?gid=2893266 | pidgey is my name sh##posting is my game
Report Abuse
M_ilo is not online. M_ilo
Joined: 25 Oct 2012
Total Posts: 2369
05 Aug 2016 07:20 PM
script.Parent.BrickColor = BrickColor.new("Baby blue")


R$63 | Rap 21,246
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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