|
| 01 Nov 2014 06:37 PM |
I am having issues with using "mouse.Hit" here is the line of code :
script.Parent.Equipped:connect(function(mouse) mouse.Button1Down:connect(function(mouse) if mouse.Hit ~= nil then local pos = mouse.Hit local clone = script.Parent.Handle:Clone() clone.Name = 'Stick' clone.CanCollide = false clone.Anchored = true clone.Position = Vector3.new(pos) clone.Parent = workspace end end) end)
When I put it into the game I get this.
1.1498642, 0, -31.3763351, 0.425794214, 0.637475729, -0.642124653, -1.4901163e-008, 0.70967114, 0.7045331, 0.904820144, -0.299986124, 0.302173823 07:33:38.874 - Players.Player1.Backpack.Tool.Script:10: bad argument #3 to 'Position' (Vector3 expected, got userdata) 07:33:38.875 - Script 'Players.Player1.Backpack.Tool.Script', Line 10 07:33:38.876 - Stack End 07:33:38.876 - Disconnected event because of exception
The values at the top are what I printed before setting the position. |
|
|
| Report Abuse |
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 01 Nov 2014 06:40 PM |
local pos = mouse.Hit Should be: local pos = mouse.Hit.p |
|
|
| Report Abuse |
|
|
| 01 Nov 2014 06:41 PM |
| Oh my gosh! Thank you so much! |
|
|
| Report Abuse |
|