alij12
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 1204 |
|
|
| 02 Jul 2014 01:52 AM |
Im new to this whole "Mouse" thingy so...
How would you make a brick's position go to a mouses position when clicked? like:
function onButton1Down(mouse) player = script.Parent.Parent.Parent b = Instance.new("Part", player) b.Name = "Test" b.Position = ??? --How would I place it where the mouse is? b.Anchored = true mouse.Icon = "rbxasset://textures\\ArrowCursor.png"
end
function onSelected(mouse) mouse.Icon = "rbxasset://textures\\ArrowCursor.png" mouse.Button1Down:connect(function() onButton1Down(mouse) end) end
script.Parent.Selected:connect(onSelected) |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2014 02:28 AM |
function onButton1Down(mouse) player = script.Parent.Parent.Parent b = Instance.new("Part", player) b.Name = "Test" b.Position = mouse.Hit.p --How would I place it where the mouse is? b.Anchored = true mouse.Icon = "rbxasset://textures\\ArrowCursor.png"
end
function onSelected(mouse) mouse.Icon = "rbxasset://textures\\ArrowCursor.png" mouse.Button1Down:connect(function() onButton1Down(mouse) end) end
script.Parent.Selected:connect(onSelected) |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2014 02:28 AM |
if not try
function onButton1Down(mouse) player = script.Parent.Parent.Parent b = Instance.new("Part", player) b.Name = "Test" b.Position = Vector3.new(mouse.Hit.p) --How would I place it where the mouse is? b.Anchored = true mouse.Icon = "rbxasset://textures\\ArrowCursor.png"
end
function onSelected(mouse) mouse.Icon = "rbxasset://textures\\ArrowCursor.png" mouse.Button1Down:connect(function() onButton1Down(mouse) end) end
script.Parent.Selected:connect(onSelected) |
|
|
| Report Abuse |
|
|