enyahs7
|
  |
| Joined: 25 Apr 2008 |
| Total Posts: 9820 |
|
|
| 27 Aug 2013 09:17 AM |
| It seems like it would be hard since they have no object in click detector that determines the coordinates. |
|
|
| Report Abuse |
|
|
chaokid9
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 6187 |
|
|
| 27 Aug 2013 09:20 AM |
| Do you mean ANYWHERE they click like a teleport tool, or like click on a specific brick and then it takes you to that brick? |
|
|
| Report Abuse |
|
|
enyahs7
|
  |
| Joined: 25 Apr 2008 |
| Total Posts: 9820 |
|
|
| 27 Aug 2013 09:24 AM |
| Like lets say I have a baseplate. I was gonna use a click detector to determine if I clicked somewhere in the baseplate ten my player moves to that coordinate. But im not sure how I would do it it doesn't seem possible. |
|
|
| Report Abuse |
|
|
Desperian
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 3371 |
|
|
| 27 Aug 2013 09:26 AM |
| Use the ':GetMouse()' method, the 'Button1Down' event, the 'hit' property of the mouse, and the ':MoveTo()' method for humanoids. |
|
|
| Report Abuse |
|
|
chaokid9
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 6187 |
|
|
| 27 Aug 2013 09:28 AM |
I'm a bit rusty on my scripting so I don't know exactly how to do it, but I can put you in the right direction. I know you don't use a click detector, but there is a property of mouse that gives the game the position of where you clicked. It is something like mouse.hit. It should return a c-frame of where the mouse clicked. Here it is: http://wiki.roblox.com/index.php/Hit_%28Property%29 |
|
|
| Report Abuse |
|
|
enyahs7
|
  |
| Joined: 25 Apr 2008 |
| Total Posts: 9820 |
|
|
| 27 Aug 2013 09:45 AM |
I have this so far but If I click how would I get it to move to mouse using mouseOrigin ?
local Player = Game.Players.LocalPlayer local Mouse = Player:GetMouse() local char = Player.Character
function move() char.Humanoid:MoveTo(Mouse.Origin, script.Parent) Mouse.Origin = char.Torso.Position end Mouse.Button1Down:connect(move)
|
|
|
| Report Abuse |
|
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
|
| 27 Aug 2013 09:50 AM |
local plr = game.Players.LocalPlayer local mouse = plr:GetMouse()
mouse.Button1Down:connect(function() plr.Character.Humanoid:MoveTo(mouse.Hit.p) end) |
|
|
| Report Abuse |
|
|
|
| 27 Aug 2013 09:52 AM |
| I think the second argument for that function is mandatory. |
|
|
| Report Abuse |
|
|
enyahs7
|
  |
| Joined: 25 Apr 2008 |
| Total Posts: 9820 |
|
|
| 27 Aug 2013 09:57 AM |
| Ye it says argument 2 missing or nil for the error with using the Mouse.Hit |
|
|
| Report Abuse |
|
|
|
| 27 Aug 2013 09:58 AM |
| Try adding script.Parent like you did before. |
|
|
| Report Abuse |
|
|
enyahs7
|
  |
| Joined: 25 Apr 2008 |
| Total Posts: 9820 |
|
|
| 27 Aug 2013 10:05 AM |
| Thanks guys I actually ended up using Workspace.Baseplate for the baseplate. |
|
|
| Report Abuse |
|
|