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: Too many copies

Previous Thread :: Next Thread 
Hopeless2 is not online. Hopeless2
Joined: 19 Oct 2011
Total Posts: 246
18 May 2013 06:19 AM
Hello.

When I use this script, to clone, I get too many clones. I only want one.

game:GetService('Players').PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(char)
c = char:findFirstChild("Head")
if (c~=nil) then
game.Lighting.test:clone().Parent = c
end
end)
end)

What do I need to add to give me only one clone? - Thanks.
Report Abuse
AdvorsusDuo is not online. AdvorsusDuo
Joined: 17 May 2012
Total Posts: 5265
18 May 2013 06:29 AM
It's being clones every time the character respawns.

Try this:

game:GetService('Players').PlayerAdded:connect(function(plr)
plr.CharacterAdded:wait()
c = plr.Character:findFirstChild("Head")
if (c~=nil) then
game.Lighting.test:clone().Parent = c
end
end)
Report Abuse
Hopeless2 is not online. Hopeless2
Joined: 19 Oct 2011
Total Posts: 246
18 May 2013 06:35 AM
Hmm... Tried that, it still copied six instead of one.
Report Abuse
SLY3 is not online. SLY3
Joined: 10 Jul 2008
Total Posts: 1700
18 May 2013 08:29 AM
Yeah dude I've had that same problem! In my script I want it to add one value to something, and it decides to add 6 instead of 1. IDK why it does that.
Report Abuse
justin2865 is not online. justin2865
Joined: 30 Dec 2011
Total Posts: 4677
18 May 2013 08:46 AM
I know, I tried cloning one brick and ended up with a water fall of bricks.
Report Abuse
Hopeless2 is not online. Hopeless2
Joined: 19 Oct 2011
Total Posts: 246
18 May 2013 02:23 PM
There must be a way to fix it?
Report Abuse
masterblokz is not online. masterblokz
Joined: 17 Nov 2010
Total Posts: 9517
18 May 2013 02:24 PM
try this

wait(1)
game:GetService('Players').PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(char)
c = char:findFirstChild("Head")
if (c~=nil) then
game.Lighting.test:clone().Parent = c
end
end)
end)
Report Abuse
badguy1233 is not online. badguy1233
Joined: 23 Jul 2009
Total Posts: 885
18 May 2013 02:26 PM
--In a brick

function onTouched(part)
c=game.Players.LocalPlayer.Character:Clone()
c.Archivable=true
c.Parent=game.Workspace --Or wherever else
end

script.Parent.Touched:connect(onTouched)
Report Abuse
Hopeless2 is not online. Hopeless2
Joined: 19 Oct 2011
Total Posts: 246
18 May 2013 02:45 PM
@Master - Still copied about 7.

@BadGuy - That's a very major edit to the script, so much that it no longer does what I want it to do!
Report Abuse
Voidion is not online. Voidion
Joined: 01 Aug 2011
Total Posts: 2668
18 May 2013 02:47 PM
I tested this and I have no extra copies...
Report Abuse
masterblokz is not online. masterblokz
Joined: 17 Nov 2010
Total Posts: 9517
18 May 2013 02:51 PM
try this...?
game:GetService('Players').PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(char)
c = char:findFirstChild("Head")
if (c~=nil) then
game.Lighting.test:clone().Parent = c
wait(1)
end
end)
end)
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
18 May 2013 02:57 PM
How are you testing this.
Report Abuse
Hopeless2 is not online. Hopeless2
Joined: 19 Oct 2011
Total Posts: 246
18 May 2013 03:04 PM
Play Solo, and server test.

Also, this is embarrassing. I must have some other script running it, I just removed the script that was cloning it, and yet it's still being cloned. I'm going to try and find what's doing that... Hold on.
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
18 May 2013 03:08 PM
I was gonna say.... there are prolly scripts that you were using before to clone it that are still running.
Report Abuse
Hopeless2 is not online. Hopeless2
Joined: 19 Oct 2011
Total Posts: 246
18 May 2013 03:10 PM
Okay, I copied that script into the Workspace, and "test" into the lighting.

It worked, only one cloned.

So, this means that there's another script somewhere in my other game cloning a load more, right?
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
18 May 2013 03:16 PM
Most likely
Report Abuse
Hopeless2 is not online. Hopeless2
Joined: 19 Oct 2011
Total Posts: 246
18 May 2013 03:19 PM
Okay, found the culprit, deleted it, now there's the opposite, NONE? There is in the other game.

What's the cause of this?
Report Abuse
Hopeless2 is not online. Hopeless2
Joined: 19 Oct 2011
Total Posts: 246
18 May 2013 03:26 PM
Hold on, I got it working!

It took three days, but it's finally working!

Thanks to all who helped!
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