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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| Joined: 19 Oct 2011 |
| Total Posts: 246 |
|
|
| 18 May 2013 02:23 PM |
| There must be a way to fix it? |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| Joined: 01 Aug 2011 |
| Total Posts: 2668 |
|
|
| 18 May 2013 02:47 PM |
| I tested this and I have no extra copies... |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
| |
|
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 |
|
|
|
| 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
|
  |
| 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 |
|
|
| |
|
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
|
  |
| 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 |
|
|