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: Seems like this should be the simplest thing ever

Previous Thread :: Next Thread 
tahu157 is not online. tahu157
Joined: 16 Nov 2008
Total Posts: 15045
05 Mar 2014 10:53 AM
I am trying to write this script that deletes one part if it comes into contact with a specified other part. This is what I have, and it seems like it should work, but it doesn't and Output doesn't give me anything either:



ObjectA = script.Parent.Torso
ObjectB = script.Parent.GoTo

function onTouch(ObjectA)
if (ObjectB ~= nil) then
ObjectB:Destroy()
end
end

ObjectA.Touched:connect(onTouch)




Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
05 Mar 2014 10:56 AM
ObjectA = script.Parent.Torso
ObjectB = script.Parent.GoTo

function onTouch()
if ObjectB ~= nil then
ObjectB:Destroy()
end
end

ObjectA.Touched:connect(onTouch)
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
05 Mar 2014 10:57 AM
BTW,anything that touchs it will make objectB destroy..
Report Abuse
tahu157 is not online. tahu157
Joined: 16 Nov 2008
Total Posts: 15045
05 Mar 2014 10:59 AM
Still doesn't work.

Thanks though.
Report Abuse
tahu157 is not online. tahu157
Joined: 16 Nov 2008
Total Posts: 15045
05 Mar 2014 11:00 AM
I think I just thought of a workaround that doesn't require the two parts come into contact.
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
05 Mar 2014 11:00 AM
output?
view-output window
Report Abuse
tahu157 is not online. tahu157
Joined: 16 Nov 2008
Total Posts: 15045
05 Mar 2014 11:05 AM
Yeah. Like I said, it doesn't give me any errors.
Report Abuse
Kingmouli is not online. Kingmouli
Joined: 28 Sep 2012
Total Posts: 1292
05 Mar 2014 11:07 AM
ObjectA = script.Parent.Torso
ObjectB = script.Parent.GoTo

function onTouch(thingThatHit)
if thingThatHit == ObjectB then
ObjectB:Destroy()
end
end

ObjectA.Touched:connect(onTouch)

I never thought I'd see you on SH Tahu, did BH get boring?
Report Abuse
tahu157 is not online. tahu157
Joined: 16 Nov 2008
Total Posts: 15045
05 Mar 2014 11:20 AM
I think everything is working perfectly expect for the :Destroy() part. I tried putting that in another place that I know works, and ObjectB still didn't disappear. Still no Output errors either.

And, nah. I still help out on BH a lot. I've just been trying to make an actual game as opposed to a build job. I'm not a great scripter, so I have to come here every now and again for help.
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