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
 

Change brick to TeamColor on button press

Previous Thread :: Next Thread 
knopie is not online. knopie
Joined: 06 Feb 2008
Total Posts: 12
20 Jun 2015 07:20 AM
When a player on lets say team blue presses the brick it should change to that teams color, The only help I found was some old 2010 and 2009 code which does not work anymore.It should be easy enough but I cant get my head arround it.

Any ideas?


function onClicked(user)

script.Parent.BrickColor = -- Here should be the team color
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
20 Jun 2015 07:24 AM
function onClicked(user)

script.Parent.BrickColor = BrickColor.new("Really ass")
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)
Report Abuse
knopie is not online. knopie
Joined: 06 Feb 2008
Total Posts: 12
20 Jun 2015 07:29 AM
And what is that seppose to do...
Report Abuse
1999bailey is not online. 1999bailey
Joined: 25 Jan 2015
Total Posts: 396
20 Jun 2015 07:34 AM
You have to define user.
Report Abuse
knopie is not online. knopie
Joined: 06 Feb 2008
Total Posts: 12
20 Jun 2015 07:40 AM
Thanks I figured it out, Was really simple I over thought it.

For anyone wondering just had to do user.TeamColor
Report Abuse
Gogeta is not online. Gogeta
Joined: 25 Nov 2006
Total Posts: 583
20 Jun 2015 07:56 AM
game.LocalPlayer = Player

function onClicked(user)

script.Parent.BrickColor = Player.TeamColor
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)
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