|
| 22 Jan 2017 06:02 AM |
This script works really weel but it only works on one part in the game, If there's more than one part the script selects one part and works well with it. I want this to work with all parts that are called Part. Copy this script into a LocalScript and put it into StarterPlayer.StarterPlayerScripts
local player = game.Players.LocalPlayer local mouse = player:GetMouse() local part = workspace.Part local target
mouse.Move:connect(function() if target then mouse.TargetFilter = target target.Position = mouse.Hit.p+Vector3.new(0,1,0) --CFraming with negate the anchoring so it will be frozen where you leave it end end)
mouse.Button1Down:connect(function() if mouse.Target and mouse.Target == part then target = part target.Anchored = true end end)
mouse.Button1Up:connect(function() mouse.TargetFilter = nil if target then target.Anchored = false target = nil end end) |
|
|
| Report Abuse |
|
|
|
| 22 Jan 2017 07:12 AM |
| Rename all the parts you want draggable to something else, and check the name of the part is what you chose. |
|
|
| Report Abuse |
|
|
|
| 22 Jan 2017 07:40 AM |
You could create a model which all of the parts in workspace named 'Part' will be inside of. And then you can use the :GetChildren() function to move all of the parts.
Or, you can store every part in the game into a table and use the pairs loop to move the parts.
Want to be supported by developers in a positive atmosphere? Then join Studio BSD: https://www.roblox.com/My/Groups.aspx?gid=1013064 |
|
|
| Report Abuse |
|
|