yankeejr
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 4906 |
|
|
| 06 Dec 2014 07:15 PM |
--How would I add distance to this so you can click all the way across the map?
Player = game.Players.LocalPlayer
local mouse = Player:GetMouse() function click() local Item = mouse.Target if Item.Name == "VehicleSeat" and Item~=nil then
Player.Character:MoveTo(Item.Position)
end end mouse.Button1Down:connect(click) |
|
|
| Report Abuse |
|
|
fret13103
|
  |
| Joined: 15 Mar 2010 |
| Total Posts: 881 |
|
|
| 06 Dec 2014 07:16 PM |
| mouse.hit.Position(x,y,z) or something like that. |
|
|
| Report Abuse |
|
|
|
| 06 Dec 2014 07:18 PM |
--How would I add distance to this so you can click all the way across the map?
Player = game.Players.LocalPlayer
local mouse = Player:GetMouse() function click() local Item = mouse.Hit if Item.Name == "VehicleSeat" and Item~=nil then Player.Character:MoveTo(Item.Position)
end end mouse.Button1Down:connect(click)
|
|
|
| Report Abuse |
|
|
yankeejr
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 4906 |
|
| |
|
yankeejr
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 4906 |
|
| |
|
fret13103
|
  |
| Joined: 15 Mar 2010 |
| Total Posts: 881 |
|
|
| 06 Dec 2014 07:25 PM |
if Item.Name == "VehicleSeat" and Item~=nil then
I forgot mouse clicks have names.
Now I feel bad for the millions of mouse click's who's names I didn't credit for the making of my games. |
|
|
| Report Abuse |
|
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 06 Dec 2014 07:26 PM |
| You should be using a ClickDetector for parts, which has a MaxDistance property, doesn't need to be in a local script (will run in the workspace) and passing an argument of the player who clicked it. |
|
|
| Report Abuse |
|
|
yankeejr
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 4906 |
|
|
| 06 Dec 2014 07:44 PM |
| This script is very important, someone help? |
|
|
| Report Abuse |
|
|
|
| 06 Dec 2014 07:46 PM |
| Have you tried using the other posts as guides or solutions? |
|
|
| Report Abuse |
|
|
yankeejr
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 4906 |
|
|
| 06 Dec 2014 07:47 PM |
| yes.. ClickDetector cannot be used in this situation. I need to have distance |
|
|
| Report Abuse |
|
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 06 Dec 2014 07:53 PM |
| If the mouse can't grab a target from that far away then there's nothing you can do. Why can't you use ClickDetectors anyway? |
|
|
| Report Abuse |
|
|