|
| 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
|
  |
| 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
|
  |
| Joined: 24 Nov 2010 |
| Total Posts: 315 |
|
|
| 05 Aug 2016 06:34 PM |
| TouchEnded * Watchout for the syntax |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| 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 |
|
|