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 » Scripting Helpers
Home Search
 

Re: OnTouch

Previous Thread :: Next Thread 
billybobtyjoseph is not online. billybobtyjoseph
Joined: 14 Aug 2011
Total Posts: 1083
25 Nov 2012 06:09 PM
How do i make this script Delete Models with it when it touches?

function onTouched(hit)
local names = {"pie", "omg", "hackr", "pls"} -- Insert any names you want here.
for k,v in pairs(names) do
if hit.Name == v then
wait()
hit:Destroy()
end
end
end
script.Parent.Touched:connect(onTouched)
Report Abuse
billybobtyjoseph is not online. billybobtyjoseph
Joined: 14 Aug 2011
Total Posts: 1083
25 Nov 2012 06:13 PM
Come On Anyone Someone Please Help
Report Abuse
Isaiahmk989 is not online. Isaiahmk989
Joined: 16 Jul 2008
Total Posts: 33
25 Nov 2012 06:17 PM
names = {"pie", "omg", "hackr", "pls"}

script.Parent.Touched:connect(function(hit)
if names[hit.Name] ~= nil then
hit:Destroy()
end
end)

Report Abuse
billybobtyjoseph is not online. billybobtyjoseph
Joined: 14 Aug 2011
Total Posts: 1083
25 Nov 2012 06:19 PM
Doesnt work
Report Abuse
crouton04 is not online. crouton04
Joined: 07 Jul 2010
Total Posts: 4459
25 Nov 2012 06:34 PM
names = {"omg","crouton04","is","so","epic"}
function ontouch(hit)
for i,v in pairs(names) do
if hit.Parent.Name == v then
wait()
v:Remove()
else
print("This is not able to be deleted!"}
end
end
end
script.Parent.Touched:connect(ontouch)

Report Abuse
crouton04 is not online. crouton04
Joined: 07 Jul 2010
Total Posts: 4459
25 Nov 2012 06:35 PM
Sorry this is if it's in a model or something..
Report Abuse
crouton04 is not online. crouton04
Joined: 07 Jul 2010
Total Posts: 4459
25 Nov 2012 06:37 PM
Change this part to make it if it's just a brick alone..

if hit.Parent.Name == v then
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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