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
 

Delete tool help

Previous Thread :: Next Thread 
Aperturee is not online. Aperturee
Joined: 22 Jan 2013
Total Posts: 306
29 Aug 2015 11:12 AM
I'm currently working on a game which is building-based, and I need help with a tool I'll be using. I made a delete tool that uses this script:

function Select(m)

if m ~= nil then
m.Icon = "http://www.roblox.com/asset/?id=75153367"
end

function onClick()
local ray = Ray.new(script.Parent.Parent.Parent.Character.Head.Position,(m.hit.p-script.Parent.Parent.Parent.Character.Head.Position).Unit*900)
local hit = workspace:FindPartOnRay(ray,script.Parent.Parent.Parent.Character)
if hit ~= nil then
if hit.Locked == false then
hit.Material = "Plastic"
hit.BrickColor = BrickColor.new("Bright red")
hit.Transparency = 0.3
local x = Instance.new("Explosion",workspace)
x.Position = hit.Position
x.BlastPressure = 0
x.BlastRadius = 1
wait(0.05)
x:Destroy()
hit:Destroy()
end
end
end
m.Button1Up:connect(onClick)

end
script.Parent.Selected:connect(Select)


So, I don't know how to limit the actual function. For example, you're 10 studs away, and you can't delete pass 10 studs. Thanks in advance.
Report Abuse
AstroCode is not online. AstroCode
Joined: 09 Oct 2009
Total Posts: 1122
29 Aug 2015 11:49 AM
To restrict the studs to 10, change the 900 to a 10
Report Abuse
Aperturee is not online. Aperturee
Joined: 22 Jan 2013
Total Posts: 306
29 Aug 2015 01:41 PM
Thanks mate, works like a charm.
Report Abuse
Aperturee is not online. Aperturee
Joined: 22 Jan 2013
Total Posts: 306
29 Aug 2015 02:11 PM
Thanks mate, works like a charm.
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