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 » Scripting Helpers
Home Search
 

Re: Mouse.Target

Previous Thread :: Next Thread 
Iteron is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. Flurite
Joined: 03 Apr 2011
Total Posts: 5386
18 Aug 2012 03:04 PM
Yes, the Material part should work.
Report Abuse
Iteron is not online. 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 is not online. Flurite
Joined: 03 Apr 2011
Total Posts: 5386
18 Aug 2012 03:08 PM
Is there any output?
Report Abuse
Iteron is not online. 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 is not online. 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 is not online. 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 is not online. 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
18cwatford is not online. 18cwatford
Joined: 08 Oct 2009
Total Posts: 5410
18 Aug 2012 03:39 PM
Just in-case, change "if Mouse.Target" to "if Mouse.Target ~= nil"
Report Abuse
Iteron is not online. Iteron
Joined: 18 Jun 2012
Total Posts: 150
18 Aug 2012 03:48 PM
That doesn't work either *sadfaic*

How odd.
Report Abuse
18cwatford is not online. 18cwatford
Joined: 08 Oct 2009
Total Posts: 5410
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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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