Iteron
|
  |
| Joined: 18 Jun 2012 |
| Total Posts: 150 |
|
|
| 18 Aug 2012 02:49 PM |
Where c is a part how do I copy over the Material through Mouse.Target?
Currently using:
c.Material = Mouse.Target.Material |
|
|
| Report Abuse |
|
|
Flurite
|
  |
| Joined: 03 Apr 2011 |
| Total Posts: 5386 |
|
|
| 18 Aug 2012 02:56 PM |
| It'd be nice to see more of your code. |
|
|
| Report Abuse |
|
|
Iteron
|
  |
| Joined: 18 Jun 2012 |
| Total Posts: 150 |
|
|
| 18 Aug 2012 02:59 PM |
a = game.Lighting.Debris:Clone() a.Parent = Workspace c = a:FindFirstChild("c") c.Material = Mouse.Target.Material
Need anything else? The rest consists of ends and other repeated things that aren't really needed. |
|
|
| Report Abuse |
|
|
Flurite
|
  |
| Joined: 03 Apr 2011 |
| Total Posts: 5386 |
|
|
| 18 Aug 2012 03:00 PM |
| Well in order to access the mouse, you need to equip/select a hopperbin/tool. |
|
|
| Report Abuse |
|
|
Iteron
|
  |
| Joined: 18 Jun 2012 |
| Total Posts: 150 |
|
|
| 18 Aug 2012 03:01 PM |
-Palm-
I have done that as I'm going to show you, all I am trying to do is not have a massive post that you have to read through the find my error, all I need is that part fixing, but if you insist....
local val = 0
script.Parent.Selected:connect(function(Mouse) val = 1 Mouse.Button1Down:connect(function() if Mouse.Target and Mouse.Target:IsA("BasePart") and val == 1 then a = game.Lighting.Debris:Clone() a.Parent = Workspace b = a:FindFirstChild("b") c = a:FindFirstChild("c") b.CFrame = CFrame.new(Mouse.Hit.x,Mouse.Hit.y-0.4,Mouse.Hit.z) * CFrame.Angles(0,90,90) c.CFrame = CFrame.new(Mouse.Hit.x,Mouse.Hit.y-0.4,Mouse.Hit.z) * CFrame.Angles(0,225,90) b.BrickColor = Mouse.Target.BrickColor c.BrickColor = Mouse.Target.BrickColor b.Material = Mouse.Target.Material c.Material = Mouse.Target.Material end end) end)
script.Parent.Deselected:connect(function() val = 0 end) |
|
|
| Report Abuse |
|
|
Flurite
|
  |
| Joined: 03 Apr 2011 |
| Total Posts: 5386 |
|
|
| 18 Aug 2012 03:04 PM |
| Yes, the Material part should work. |
|
|
| Report Abuse |
|
|
Iteron
|
  |
| Joined: 18 Jun 2012 |
| Total Posts: 150 |
|
|
| 18 Aug 2012 03:06 PM |
Well it doesn't.
Take the script into your own place and try it, I don't understand. :( |
|
|
| Report Abuse |
|
|
Flurite
|
  |
| Joined: 03 Apr 2011 |
| Total Posts: 5386 |
|
| |
|
Iteron
|
  |
| Joined: 18 Jun 2012 |
| Total Posts: 150 |
|
|
| 18 Aug 2012 03:17 PM |
| No, as you've said above it should work and hence has no error messages. It just doesn't copy the part Material / Color. |
|
|
| Report Abuse |
|
|
Flurite
|
  |
| Joined: 03 Apr 2011 |
| Total Posts: 5386 |
|
|
| 18 Aug 2012 03:22 PM |
| After assigning b.Material and c.Material to the target's material, print their materials to see if they have been changed. |
|
|
| Report Abuse |
|
|
Iteron
|
  |
| Joined: 18 Jun 2012 |
| Total Posts: 150 |
|
|
| 18 Aug 2012 03:25 PM |
I did print(c.Material) before and after I changed the Material and recieved the same thing both times.
Enum.Material.Plastic Enum.Material.Plastic |
|
|
| Report Abuse |
|
|
Flurite
|
  |
| Joined: 03 Apr 2011 |
| Total Posts: 5386 |
|
|
| 18 Aug 2012 03:34 PM |
No idea what world your script is in because I did some tests with a similar idea, and things worked perfectly fine.
|
|
|
| Report Abuse |
|
|
|
| 18 Aug 2012 03:39 PM |
| Just in-case, change "if Mouse.Target" to "if Mouse.Target ~= nil" |
|
|
| Report Abuse |
|
|
Iteron
|
  |
| Joined: 18 Jun 2012 |
| Total Posts: 150 |
|
|
| 18 Aug 2012 03:48 PM |
That doesn't work either *sadfaic*
How odd. |
|
|
| Report Abuse |
|
|
|
| 18 Aug 2012 03:49 PM |
| I saw mine didn't work after I read what you said about the print. Idk whats wrong, cause I see nothing wrong with the line. |
|
|
| Report Abuse |
|
|
Flurite
|
  |
| Joined: 03 Apr 2011 |
| Total Posts: 5386 |
|
|
| 18 Aug 2012 03:58 PM |
Comment out all the stuff before it and see if it works.
Is this the whole script? |
|
|
| Report Abuse |
|
|