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: What am i doing wrong?...

Previous Thread :: Next Thread 
AprilFirst is not online. AprilFirst
Joined: 19 Jul 2012
Total Posts: 186
10 Aug 2012 01:16 AM
i want it so that if a brick named "Part" hits this brick, the "Part" brick is removed

function onHit(hit)
if hit.Parent.Name == "Part" then
hit.Parent:Remove()
end

game.Workspace.Remover.hit:connect(onHit)



i cant find a problem...
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
10 Aug 2012 01:24 AM
Two problems. You're missing an end, and the event is called Touched, not hit.

    function onHit(hit)
        if hit.Parent.Name == "Part" then
            hit.Parent:Remove()
        end
    end
    game.Workspace.Remover.Touched:connect(onHit)

http://wiki.roblox.com/index.php/User:ElectricBlaze
Report Abuse
AprilFirst is not online. AprilFirst
Joined: 19 Jul 2012
Total Posts: 186
10 Aug 2012 01:28 AM
oh, but even with the fixes it doesnt work
Report Abuse
StickyPigeon is not online. StickyPigeon
Joined: 29 Feb 2012
Total Posts: 40
10 Aug 2012 02:17 AM
You capitalized Remove. It's lower case.
Report Abuse
PETYO39 is not online. PETYO39
Joined: 17 May 2008
Total Posts: 4950
10 Aug 2012 02:22 AM
@stickypigeon

wrong, that doesn't matter what so ever. It can be part:Remove() or part:remove()
Report Abuse
romaster512 is not online. romaster512
Joined: 13 Mar 2009
Total Posts: 1250
10 Aug 2012 02:35 AM
Remove was replaced by Destroy a long time ago...
Report Abuse
StickyPigeon is not online. StickyPigeon
Joined: 29 Feb 2012
Total Posts: 40
10 Aug 2012 02:41 AM
:O your petyo 39 i watch your tutorials. Their pretty good. And ooh sorry then. I just never capitalize remove when i use it.
Report Abuse
StickyPigeon is not online. StickyPigeon
Joined: 29 Feb 2012
Total Posts: 40
10 Aug 2012 02:44 AM
and try this in your remover

brick = script.Parent

function onHit(hit)
if hit.Parent.ClassName == "Part" then
hit.Parent:remove()
end
end
brick.Touched:connect(onHit)
Report Abuse
AprilFirst is not online. AprilFirst
Joined: 19 Jul 2012
Total Posts: 186
10 Aug 2012 02:54 AM
i already got it, i looked at some free model remover to find out what i was doing different and got it, but thanks for the help everyone
Report Abuse
nuclearguy00 is not online. nuclearguy00
Joined: 06 Apr 2010
Total Posts: 26
10 Aug 2012 04:49 AM
the roblox output always tells you why the script doesnt work
if your on roblox studio. just click view and then output
Report Abuse
Gyration is not online. Gyration
Joined: 06 Aug 2012
Total Posts: 9
10 Aug 2012 04:52 AM
> romaster512

They never replaced Remove, as Remove is still available to be used. They added Destroy, though, so Remove can slowly become less used, so when they do remove it, it'd affect less people.
Report Abuse
ArceusInator is not online. ArceusInator
Joined: 10 Oct 2009
Total Posts: 30553
10 Aug 2012 05:01 AM
You guys have it all wrong. Remove and Destroy are two totally different things.

Remove will parent an object to nil and call Remove on all of its children.

Destroy will parent an object to nil, call Destroy on all of its children, remove all variable assignments to the object, and then GC.
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