|
| 16 May 2015 08:29 AM |
Every part i roll my mouse over gets one, and unless i delete it, it doesnt go away.
Code:
elseif Mode == "Deleting" then
Deleting = true
wait()
if PartClone then PartClone:Destroy() wait() end
mouse.Icon = "rbxasset://textures\\HammerCursor.png"
local function MakeSelectionBox()
if mouse.Target ~= nil and mouse.Target:IsA("BasePart") and mouse.Target.Locked == false and Deleting == true then
sBox = Instance.new("SelectionBox",mouse.Target)
spawn(function() for i = 1,math.huge do sBox.Adornee = mouse.Target wait() end end)
sBox.Color = BrickColor.new("Really black")
end end
MakeSelectionBox()
mouse.Button1Down:connect(function() if mouse.Target ~= nil and mouse.Target:IsA("BasePart") and mouse.Target.Locked == false and Deleting == true then mouse.Target:Destroy() MakeSelectionBox() end end) end end end) |
|
|
| Report Abuse |
|
|
| |
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 16 May 2015 09:48 PM |
Easy, just create a single box in the beginning and set its adornee to mouse.target.
local box = Instance.new("SelectionBox",script)
spawn(function() while true do wait() if mouse.target then if not mouse.target.Locked then if Deleting then box.Adornee = mouse.target else box.Adornee = nil end else box.Adornee = nil end else box.Adornee = nil end end end)
I script -~ chimmihc |
|
|
| Report Abuse |
|
|
|
| 07 Jun 2016 02:46 AM |
script.Parent.Adornee = game.Workspace.Part: SelectionBox SelectionSphere & more |
|
|
| Report Abuse |
|
|