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: I need help with this script.

Previous Thread :: Next Thread 
Solttu is not online. Solttu
Joined: 05 Jan 2010
Total Posts: 86
03 Mar 2017 10:25 AM
Can you help me fix this script?

local B = script.Parent:FindFirstChild("Base")

while true do
if B == nil then
wait()
script.Parent:Destroy()

end

The point of the script would be to destroy the whole model after it detects that the base inside the model no longer exists.

Thanks in advance!
Report Abuse
NitroxicGaming is online. NitroxicGaming
Joined: 10 Nov 2015
Total Posts: 7
03 Mar 2017 10:26 AM
Where did you learn Lua?
Report Abuse
Solttu is not online. Solttu
Joined: 05 Jan 2010
Total Posts: 86
03 Mar 2017 10:28 AM
Youtube, Wiki etc.
Report Abuse
Mister_Manakin is not online. Mister_Manakin
Joined: 16 Sep 2009
Total Posts: 1935
03 Mar 2017 10:41 AM
script.Parent.ChildRemoved:connect(function(object)

if (object.Name == "Base") then
script.Parent:Destroy()
end

end)
Report Abuse
Solttu is not online. Solttu
Joined: 05 Jan 2010
Total Posts: 86
03 Mar 2017 10:44 AM
It works. Thanks!
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