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: Problem with Clone()

Previous Thread :: Next Thread 
helicopter35 is not online. helicopter35
Joined: 25 Oct 2010
Total Posts: 1225
01 Mar 2015 10:23 AM
Just doing some testing, one part will open a map, other will close it. However, it won't clone the map from Lighting, it just moves it to Workspace. Here's what I have...

--Open Map

m = game.Lighting.Map1
p = game.Workspace.PartTest

p.Touched:connect(function()
m:Clone()
m.Parent = game.Workspace
m.Position = -51.158, 0.2, -49.996
end)

_______________________________________

--Close Map

m = game.Lighting.Map1
p1 = game.Workspace.PartTest1

p1.Touched:connect(function()
if m.Parent == game.Workspace then
m:Destroy()
wait(0.03)
return m.Parent == game.Lighting
end
end)
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
01 Mar 2015 10:24 AM
You need to store the clone of m in a variable. The clone's parent will be nil by default, and then you set it.
Report Abuse
helicopter35 is not online. helicopter35
Joined: 25 Oct 2010
Total Posts: 1225
01 Mar 2015 10:34 AM
So something like...

mclone = game.Workspace.Map1


Because, once it's cloned, it's moved to Workspace which then makes that a valid variable..?
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
01 Mar 2015 10:46 AM
mclone = m:Clone()
Report Abuse
helicopter35 is not online. helicopter35
Joined: 25 Oct 2010
Total Posts: 1225
01 Mar 2015 11:51 AM
Thank you, appreciate it.
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