generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Brick placing

Previous Thread :: Next Thread 
alij12 is not online. 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
curtisornot is not online. curtisornot
Joined: 30 Jun 2008
Total Posts: 1271
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
curtisornot is not online. curtisornot
Joined: 30 Jun 2008
Total Posts: 1271
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image