I need a script for a part that i can grab like in Lumber Tycoon 2
01 | ` function onButton 1 Down(mouse) |
02 | local hit = mouse.Target |
03 |
04 | if (hit = = nil ) then |
05 | return end |
06 |
07 | if (hit:isA( "Part" )) then |
08 | if (hit.Locked = = false ) then |
09 | -- hit.BrickColor = BrickColor.new("Bright red") |
10 | hit.Position = mouse.Hit.p + Vector 3. new( 0 , part.Size.y/ 2 , 0 ) |
11 | end |
12 | end |
13 | end |
14 |
15 | function onSelected(mouse) |
16 | mouse.Icon = "rbxasset://textures\\GunCursor.png" |
17 | mouse.Button 1 Down:connect( function () onButton 1 Down(mouse) end ) |
18 | end |
19 |
20 | bin.Selected:connect(onSelected) ` |
Closed as Not Constructive by BlueTaslem
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?