SirGalith
|
  |
| Joined: 24 Jan 2010 |
| Total Posts: 209 |
|
|
| 16 Aug 2014 09:17 PM |
why wont thisthis mouse.Target.Changed:connect(function()OnChanged(mouse) end) call this function OnChanged(mouse)
Thanks! |
|
|
| Report Abuse |
|
swmaniac
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
|
| 16 Aug 2014 09:26 PM |
It'll run, but it won't work as expected.
If the mouse is pointing at a brick, then that brick is the mouse's target. So
mouse.Target.Changed will resolve to the Brick's Changed event. Your function will listen for changes to the Brick's properties, not the mouse's.
What you want is something like:
mouse.Changed:connect(function(Prop) if Prop == "Target" then OnChanged(mouse) end end) |
|
|
| Report Abuse |
|
SirGalith
|
  |
| Joined: 24 Jan 2010 |
| Total Posts: 209 |
|
| |