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: Help x2

Previous Thread :: Next Thread 
TheBlueRivers is not online. TheBlueRivers
Joined: 20 Jul 2011
Total Posts: 2555
10 Jul 2015 10:15 PM
This is terrible

but

function touch(hit)
if hit.Parent.Classname == "Hat"
then hit.Parent.Hat:Destroy()
end
end

script.Parent.Touched:connect(touch)


I want it to delete a hat if it finds it
Report Abuse
C1F8 is not online. C1F8
Joined: 15 Apr 2013
Total Posts: 240
10 Jul 2015 10:16 PM
Try this:
function added(child)
if child:IsA("Hat") then child:destroy() end end
workspace.ChildAdded:connect(added)
Report Abuse
Irradiant is not online. Irradiant
Joined: 31 May 2012
Total Posts: 56114
10 Jul 2015 10:31 PM
game.Workspace.ChildAdded:connect(function(newChild)
if newChild.ClassName == "Hat" then
newChild:Destroy()
end
end)


ROBUX: R$11,691
Report Abuse
Cmaj7 is not online. Cmaj7
Joined: 28 Dec 2008
Total Posts: 36653
10 Jul 2015 10:42 PM
irradiant beat me to it
Report Abuse
TheBlueRivers is not online. TheBlueRivers
Joined: 20 Jul 2011
Total Posts: 2555
10 Jul 2015 10:51 PM
I want it so when you touch a block that happens


"game.Workspace.ChildAdded:connect(function(newChild)
if newChild.ClassName == "Hat" then
newChild:Destroy()
end
end)
"


So that doesnt work
Report Abuse
Irradiant is not online. Irradiant
Joined: 31 May 2012
Total Posts: 56114
10 Jul 2015 10:53 PM
If you want it to remove your hats when you touch a brick then

script.Parent.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
for i, hat in ipairs(hit.Parent:GetChildren()) do
if hat.ClassName == "Hat" then
hat:Destroy()
end
end
end
end)


ROBUX: R$11,691
Report Abuse
TheBlueRivers is not online. TheBlueRivers
Joined: 20 Jul 2011
Total Posts: 2555
10 Jul 2015 11:13 PM
Thanks Irradiant.
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