RoAnt
|
  |
| Joined: 14 Jul 2008 |
| Total Posts: 16794 |
|
|
| 17 Jan 2012 10:33 PM |
What define the mouse position once it is clicked in tool? I'm better at hopperbin than tool.
script.Parent.Activated:connect(function() --[[mouse ??? ]]-- end) |
|
|
| Report Abuse |
|
|
|
| 17 Jan 2012 10:34 PM |
tool.Selected:connect(function() print("Tool was clicked") end) |
|
|
| Report Abuse |
|
|
RoAnt
|
  |
| Joined: 14 Jul 2008 |
| Total Posts: 16794 |
|
|
| 17 Jan 2012 10:36 PM |
Selected is not in Tool. Plus, that doesn't show the part where mouse was being clicked. It online prints if the hopperbin was selected. I'm talking about Tools here. |
|
|
| Report Abuse |
|
|
|
| 17 Jan 2012 10:36 PM |
nope:
tool.Selected:connect(function(mouse) mouse.Button1Down:connect(function() print("clicked") end) end) |
|
|
| Report Abuse |
|
|
|
| 17 Jan 2012 10:38 PM |
| oh, i thought by tool u meant hopper bin, cuz quenty used hopperbin event |
|
|
| Report Abuse |
|
|
|
| 17 Jan 2012 10:38 PM |
tool.Selected:connect(function(mouse) mouse.Button1Down:connect(function() if mouse.Object then print("clicked"..mouse.Object.Name) else print("No target") end end) end)
|
|
|
| Report Abuse |
|
|
|
| 17 Jan 2012 10:38 PM |
tool.Equipped:connect(function(mouse) mouse.Button1Down:connect(function() if mouse.Object then print("clicked"..mouse.Object.Name) else print("No target") end end) end)
Sorry. |
|
|
| Report Abuse |
|
|
|
| 17 Jan 2012 10:40 PM |
| whats the difference between mouse.Target and mouse.Object? |
|
|
| Report Abuse |
|
|
RoAnt
|
  |
| Joined: 14 Jul 2008 |
| Total Posts: 16794 |
|
|
| 17 Jan 2012 10:54 PM |
If the direction you clicked is in front of you, it will call the function fire()? Using the Activated event, not the Equipped.
function onActivated() local character = Tool.Parent; local humanoid = character.Humanoid if not humanoid then print("Humanoid not found") return end local targetPos = humanoid.TargetPoint local lookAt = (targetPos - character.Head.Position).unit if --[[Help on this. What do I use?]]-- then fire(lookAt) end Tool.Enabled = true end |
|
|
| Report Abuse |
|
|