View previous topic :: View next topic |
Author |
Message |
freaked Beginner Poster
Joined: 26 May 2008 Posts: 20
|
Posted: Mon May 26, 2008 1:26 am Post subject: Double Clone? |
|
|
Why when I touch the clone button, I get two copys of clones? Here is the script:
function onTouch(hit)
p = game.Players:playerFromCharacter(hit.Parent)
if p~=nil then
ff = script.Parent.Parent.Figure1:findFirstChild("Freaked"):clone()
ff:findFirstChild("Head").BrickColor = p.Character:findFirstChild("Head").BrickColor
ff:findFirstChild("Torso").BrickColor = p.Character:findFirstChild("Torso").BrickColor
ff:findFirstChild("Right Arm").BrickColor = p.Character:findFirstChild("Right Arm").BrickColor
ff:findFirstChild("Right Leg").BrickColor = p.Character:findFirstChild("Right Leg").BrickColor
ff:findFirstChild("Left Leg").BrickColor = p.Character:findFirstChild("Left Leg").BrickColor
ff:findFirstChild("Left Arm").BrickColor = p.Character:findFirstChild("Left Arm").BrickColor
ff.Parent = workspace
ff:MoveTo(p.Character.Torso.Position + Vector3.new(0, 0, 10))
ff:MakeJoints()
ff.Name = p.Name .. ""
ff.Torso.Locked = false
ff.Head.Locked = false
ps1 = p.Character:findFirstChild("Shirt")
if ps1==nil then return "moo" end
ps = ps1:clone()
ps.Parent = ff
pp1 = p.Character:findFirstChild("Pants")
if pp1==nil then return "moo" end
pp = pp1:clone()
pp.Parent = ff
wait(5)
else return "not a player"
end
end
Please help! _________________
http://robloxhub.wordpress.com |
|
Back to top |
|
|
SirGelatina Site Admin
Joined: 01 Mar 2008 Posts: 116 Location: Behind you
|
Posted: Mon May 26, 2008 6:32 pm Post subject: |
|
|
Because you need a debounce!
And something like this is easier:
Code: | local debounce = false
function onTouched(Toucher)
local player = game.Players:playerFromCharacter(Toucher.Parent)
if player ~= nil and debounce == false then
debounce = true
local torsopos = Toucher.Parent.Torso.Position
local list = Toucher.Parent:getChildren()
local model = Instance.new("Model")
for x=1, #list do
local clone = list[x]:clone()
if clone ~= nil then
clone.Parent = model
end
end
model:makeJoints()
model:MoveTo(Vector3.new(torsopos.x, torsopos.y + 10, torsopos.z))
model:makeJoints()
model.Parent = Toucher.Parent.Parent
model:MoveTo(Vector3.new(torsopos.x, torsopos.y + 10, torsopos.z))
model:makeJoints()
wait(3)
debounce = false
end
end
script.Parent.Touched:connect(onTouched) |
Last edited by SirGelatina on Wed May 28, 2008 7:09 pm; edited 1 time in total |
|
Back to top |
|
|
freaked Beginner Poster
Joined: 26 May 2008 Posts: 20
|
|
Back to top |
|
|
SirGelatina Site Admin
Joined: 01 Mar 2008 Posts: 116 Location: Behind you
|
Posted: Wed May 28, 2008 7:10 pm Post subject: |
|
|
You tested it online or offline? I tested offline and it worked. Take the code again from there. I made some changes. |
|
Back to top |
|
|
freaked Beginner Poster
Joined: 26 May 2008 Posts: 20
|
Posted: Fri May 30, 2008 1:40 am Post subject: |
|
|
I want to ask. When you touch it, how would you get the figure name to be the same as the toucher? Also, why when I touch the button, a figure pops up but with no legs and arms? ANd how would you position it? _________________
http://robloxhub.wordpress.com |
|
Back to top |
|
|
Nasadaws Delta Corp Moderator
Joined: 27 Mar 2008 Posts: 484 Location: Under you bed Where else?
|
Posted: Fri May 30, 2008 6:11 am Post subject: |
|
|
I'm getting the "No Arms" Thing with my script. _________________ Nasadaws Attack Spammer: Hits 100 Damage with his Ban Hama.
Spammer: Flees.
I R NOE WELDIN ME BAN HAMAR. |
|
Back to top |
|
|
freaked Beginner Poster
Joined: 26 May 2008 Posts: 20
|
|
Back to top |
|
|
Nasadaws Delta Corp Moderator
Joined: 27 Mar 2008 Posts: 484 Location: Under you bed Where else?
|
Posted: Sat May 31, 2008 8:23 am Post subject: |
|
|
You need to put the the figure into lighting.
To put it into lighting, You Copy the Model and then paste into lighting. _________________ Nasadaws Attack Spammer: Hits 100 Damage with his Ban Hama.
Spammer: Flees.
I R NOE WELDIN ME BAN HAMAR. |
|
Back to top |
|
|
freaked Beginner Poster
Joined: 26 May 2008 Posts: 20
|
Posted: Sat May 31, 2008 7:04 pm Post subject: |
|
|
So if you put the figure in Lightning it, would be like a weapon giver? Would it put it in workspace or Starterpack which won't work? _________________
http://robloxhub.wordpress.com |
|
Back to top |
|
|
Nasadaws Delta Corp Moderator
Joined: 27 Mar 2008 Posts: 484 Location: Under you bed Where else?
|
Posted: Sat May 31, 2008 7:11 pm Post subject: |
|
|
Putting it into workspace seems to not copy a figures arms, Just try to put it in and try then. _________________ Nasadaws Attack Spammer: Hits 100 Damage with his Ban Hama.
Spammer: Flees.
I R NOE WELDIN ME BAN HAMAR. |
|
Back to top |
|
|
freaked Beginner Poster
Joined: 26 May 2008 Posts: 20
|
|
Back to top |
|
|
|