Evilastro
|
  |
| Joined: 11 Jul 2010 |
| Total Posts: 531 |
|
|
| 02 Mar 2014 10:45 AM |
Hey guys, so I'm making this mini wipeout thing, and I need to edit this script but I can't seem to get it right.
Anyway, what I need happening is instead of the colour changing, I want the material to change instead while the colour stays the same. Is that possible?
Below is the script ---------------------------------
function onTouch(part) local human = part.Parent:findFirstChild("Humanoid") part.BrickColor = BrickColor.new(18) end
script.Parent.Touched:connect(onTouch) |
|
|
| Report Abuse |
|
|
Evilastro
|
  |
| Joined: 11 Jul 2010 |
| Total Posts: 531 |
|
|
| 02 Mar 2014 10:46 AM |
Here's a prntscr of the script:
http:// prntscr (dot) com / 2x83ob |
|
|
| Report Abuse |
|
|
|
| 02 Mar 2014 10:49 AM |
function onTouch(part) human = part.Parent:findFirstChild("Humanoid") if human~=nil then part.BrickColor = BrickColor.new(Br. yellowish orange) end
script.Parent.Touched:connect(onTouch) |
|
|
| Report Abuse |
|
|
Evilastro
|
  |
| Joined: 11 Jul 2010 |
| Total Posts: 531 |
|
|
| 02 Mar 2014 10:55 AM |
I think I may have explained it wrong, by material I mean turning from Plastic into Corroded Metal. :P
So instead of having the brick change colour when it touches the brick the script is in, it will change it from plastic to Corroded Metal |
|
|
| Report Abuse |
|
|
|
| 02 Mar 2014 10:56 AM |
function onTouch(part) human = part.Parent:findFirstChild("Humanoid") if human~=nil then part.Material = "CorrodedMetal" end
script.Parent.Touched:connect(onTouch) |
|
|
| Report Abuse |
|
|
|
| 02 Mar 2014 11:45 AM |
local Part=script.Parent local Materials={ 'Brick', 'Concrete', 'CorrodedMetal', 'DiamondPlate', 'Fabric', 'Foil', 'Granite', 'Grass', 'Ice', 'Marble', 'Pebble', 'Plastic', 'Sand', 'Slate', 'SmoothPlastic', 'Wood' } Part.Touched:connect(function(Obj) if Obj.Parent.ClassName=='Model'and Obj.Parent:findFirstChild('Humanoid')and Obj.Parent:findFirstChild('Torso')then Part.Material=Materials[math.random(1,#Materials)] return Part.Material end end) |
|
|
| Report Abuse |
|
|
|
| 02 Mar 2014 11:50 AM |
juniors got the right idea :3 otherwise,just set part.Material to a specific one |
|
|
| Report Abuse |
|
|