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 » Scripters
Home Search
 

Re: Creates too many selection boxes..

Previous Thread :: Next Thread 
TheNewChicken is not online. TheNewChicken
Joined: 18 Mar 2015
Total Posts: 1997
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
TheNewChicken is not online. TheNewChicken
Joined: 18 Mar 2015
Total Posts: 1997
16 May 2015 09:21 PM
b1
Report Abuse
chimmihc is not online. 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
TheVladeCruz is not online. TheVladeCruz
Joined: 23 Dec 2015
Total Posts: 6
07 Jun 2016 02:46 AM
script.Parent.Adornee = game.Workspace.Part:
SelectionBox
SelectionSphere
& more
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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