trytry1
|
  |
| Joined: 18 Dec 2010 |
| Total Posts: 129 |
|
|
| 13 Nov 2016 07:06 PM |
model:MoveTo(mouse.hit.p)
model is a model that will be placed when you click on your baseplate. it's position is going to be where you click (Ask me if you need more code but this is what i was working on) |
|
|
| Report Abuse |
|
|
Vaae
|
  |
| Joined: 06 May 2013 |
| Total Posts: 1254 |
|
|
| 13 Nov 2016 07:20 PM |
model:MoveTo(mouse.Hit.p.X%1, mouse.Hit.p.Y%1, mouse.Hit.p.Z%1)
I believe that'll work, either that or I'm a little too messed up right now if ya feel me haha |
|
|
| Report Abuse |
|
|
trytry1
|
  |
| Joined: 18 Dec 2010 |
| Total Posts: 129 |
|
| |
|
trytry1
|
  |
| Joined: 18 Dec 2010 |
| Total Posts: 129 |
|
|
| 13 Nov 2016 07:22 PM |
Every time i try (Including yours) to round it gives me this error:
Unable to cast double to Vector3 |
|
|
| Report Abuse |
|
|
trytry1
|
  |
| Joined: 18 Dec 2010 |
| Total Posts: 129 |
|
|
| 13 Nov 2016 07:23 PM |
| Do you know what that means? |
|
|
| Report Abuse |
|
|
Vaae
|
  |
| Joined: 06 May 2013 |
| Total Posts: 1254 |
|
|
| 13 Nov 2016 07:25 PM |
Made a mistake, sorry.
model:MoveTo(mouse.Hit.p.X - mouse.Hit.p.X%1, mouse.Hit.p.Y - mouse.Hit.p.Y%1, mouse.Hit.p.Z - mouse.Hit.p.Z%1)
Try that. |
|
|
| Report Abuse |
|
|
trytry1
|
  |
| Joined: 18 Dec 2010 |
| Total Posts: 129 |
|
| |
|
trytry1
|
  |
| Joined: 18 Dec 2010 |
| Total Posts: 129 |
|
| |
|
Vaae
|
  |
| Joined: 06 May 2013 |
| Total Posts: 1254 |
|
|
| 13 Nov 2016 07:28 PM |
| Can you post the entire snippet of code around the :MoveTo()? |
|
|
| Report Abuse |
|
|
trytry1
|
  |
| Joined: 18 Dec 2010 |
| Total Posts: 129 |
|
|
| 13 Nov 2016 07:30 PM |
function onButton1Down(mouse) if mouse.Target.Name == "BuildingPlates" then if mouse.Target.Owner.Value == game.Players.LocalPlayer.Character then local model = bin.Blueprint:clone() model.Parent = mouse.Target model:MakeJoints() print(mouse.hit.p) model:MoveTo(mouse.Hit.p.X - mouse.Hit.p.X%1, mouse.Hit.p.Y - mouse.Hit.p.Y%1, mouse.Hit.p.Z - mouse.Hit.p.Z%1)--model:MoveTo(mouse.hit.p) else print(mouse.Target.Owner.Value) print("Fail") end else print("Wrong Part") end end
that is the function, and it is called later on with left click |
|
|
| Report Abuse |
|
|
|
| 13 Nov 2016 07:31 PM |
| you made a variable for the mouse right?? |
|
|
| Report Abuse |
|
|
trytry1
|
  |
| Joined: 18 Dec 2010 |
| Total Posts: 129 |
|
|
| 13 Nov 2016 07:33 PM |
No. mouse is the... i forgot what they are called example:
function onButton1Down(mouse)
end |
|
|
| Report Abuse |
|
|
|
| 13 Nov 2016 07:36 PM |
you have to make the variable for the mouse: local mouse = game.Player:GetMouse() |
|
|
| Report Abuse |
|
|
trytry1
|
  |
| Joined: 18 Dec 2010 |
| Total Posts: 129 |
|
|
| 13 Nov 2016 07:38 PM |
| Both lead to the same spot though. Does it make a difference? |
|
|
| Report Abuse |
|
|
|
| 13 Nov 2016 07:40 PM |
| roblox studio wont know what the heck a mouse is until you specifically make a variable for it. i might possibly be wrong but chances are low |
|
|
| Report Abuse |
|
|
trytry1
|
  |
| Joined: 18 Dec 2010 |
| Total Posts: 129 |
|
|
| 13 Nov 2016 07:44 PM |
in the code it does know what the mouse is because mouse is the thing that made the button1down call it and it is in the parenthesees also i tried making a variable got same error
Unable to cast double to Vector3 |
|
|
| Report Abuse |
|
|
Vaae
|
  |
| Joined: 06 May 2013 |
| Total Posts: 1254 |
|
|
| 13 Nov 2016 07:47 PM |
Try this, doubt this'll fix it but its worth a try lol, no idea why I can't find the error lol.
model:MoveTo(Vector3.new(mouse.Hit.p.X%1, mouse.Hit.p.Y%1, mouse.Hit.p.Z%1)) |
|
|
| Report Abuse |
|
|
trytry1
|
  |
| Joined: 18 Dec 2010 |
| Total Posts: 129 |
|
|
| 13 Nov 2016 07:49 PM |
| Good news and bad news. the good news is there was no error yay! but the bad news is that it did not place the block where the mouse clicked. it placed it at Vector3.new(0, 0, 0) |
|
|
| Report Abuse |
|
|
Vaae
|
  |
| Joined: 06 May 2013 |
| Total Posts: 1254 |
|
|
| 13 Nov 2016 07:51 PM |
Made a mistake again -_- LOL
model:MoveTo(Vector3.new(mouse.Hit.p.X - mouse.Hit.p.X%1, mouse.Hit.p.Y - mouse.Hit.p.Y%1, mouse.Hit.p.Z - mouse.Hit.p.Z%1)) |
|
|
| Report Abuse |
|
|
trytry1
|
  |
| Joined: 18 Dec 2010 |
| Total Posts: 129 |
|
|
| 13 Nov 2016 07:54 PM |
| It worked! thank you. when i was trying i was nowhere near your answer xD. |
|
|
| Report Abuse |
|
|
Vaae
|
  |
| Joined: 06 May 2013 |
| Total Posts: 1254 |
|
|
| 13 Nov 2016 07:55 PM |
| No problem haha, can't believe it took me that long to see that I forgot to type vector3.new lmao. |
|
|
| Report Abuse |
|
|