|
| 09 Aug 2012 10:13 PM |
Hello. My clone script won't work. The output keeps saying
"Workspace.clone Brick.Clone me:13: '=' expected near 'clonep'"
But i have no idea why =/
can anyone help me? Here is the script.
P = game.Workspace.StickyPigeon cloneP = P:clone() getall = game.Workspace:GetChildren() brick = game.Workspace.Parent
function cloneall(hit) hum = hit.Parent:FindFirstChild("Humanoid") if hum ~= nil and hum == P.Humanoid then for i = 1, #getall do if getall[i].ClassName == "Part" then wait(1) clonep clonep.Parent = game.Workspace clonep.Position = Vector3.new(math.random(0, 50), math.random(0,50), math.random(0, 50) clonep:MakeJoints() end end end end
brick.Touched:connect(cloneall)
|
|
|
| Report Abuse |
|
|
|
| 09 Aug 2012 10:35 PM |
I fixed some errors and changed the script to this
P = game.Workspace.Player getall = game.Workspace:GetChildren() brick = script.Parent
function cloneall(hit) hum = hit.Parent:FindFirstChild("Humanoid") if hum ~= nil and hum == P.Humanoid then for i = 1, #getall do if getall[i].ClassName == "Part" then wait(1) clonep = P:clone() clonep.Parent = game.Workspace clonep.Position = Vector3.new(math.random(0, 50), math.random(0,50), math.random(0, 50)) clonep:MakeJoints() end end end end
brick.Touched:connect(cloneall)
But now the output says this
Workspace.clone Brick.Clone me:12: attempt to index global 'clonep' (a nil value)
|
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 09 Aug 2012 11:07 PM |
| Bump. Why is everyone ignoring my script -_- |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
|
| 10 Aug 2012 12:57 AM |
| Added another end. Just gave me a different error =/ i'm pretty sure i have enough ends. |
|
|
| Report Abuse |
|
|
|
| 10 Aug 2012 01:57 AM |
| are you testing in game mode? because if you test in solo your name isnt "StickyPigeon" its player |
|
|
| Report Abuse |
|
|
|
| 10 Aug 2012 02:14 AM |
Yeah i'm testing in solo and i figured that out and the new script is but it says
"Workspace.clone Brick.Clone me:12: attempt to index global 'clonep' (a nil value)"
P = game.Workspace.Player getall = game.Workspace:GetChildren() brick = script.Parent
function cloneall(hit) hum = hit.Parent:FindFirstChild("Humanoid") if hum ~= nil and hum == P.Humanoid then for i = 1, #getall do if getall[i].ClassName == "Part" then wait(1) clonep = P:clone() clonep.Parent = game.Workspace clonep.Position = Vector3.new(math.random(0, 50), math.random(0,50), math.random(0, 50)) clonep:MakeJoints() end end end end
brick.Touched:connect(cloneall)
|
|
|
| Report Abuse |
|
|
|
| 10 Aug 2012 02:15 AM |
* The output that the script above is returning is this
"
Workspace.clone Brick.Clone me:12: attempt to index global 'clonep' (a nil value)
" |
|
|
| Report Abuse |
|
|
|
| 10 Aug 2012 02:17 AM |
| Try putting local clonep at line 12, |
|
|
| Report Abuse |
|
|
|
| 10 Aug 2012 02:19 AM |
Nothing :/
just returns this
"Workspace.clone Brick.Clone me:12: attempt to index local 'clonep' (a nil value)" |
|
|
| Report Abuse |
|
|
| |
|
|
| 10 Aug 2012 02:23 AM |
| First line is messed up... |
|
|
| Report Abuse |
|
|
| |
|
|
| 10 Aug 2012 02:31 AM |
| "Player is not a valid member of workspace" |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
| |
|
|
| 10 Aug 2012 03:09 AM |
| Are you using a local script or a regular one? |
|
|
| Report Abuse |
|
|
|
| 10 Aug 2012 03:15 AM |
Regular This is the current script
P = game.Workspace.Player getall = game.Workspace:GetChildren() brick = script.Parent
function cloneall(hit) hum = hit.Parent:FindFirstChild("Humanoid") if hum ~= nil and hum == P.Humanoid then for i = 1, #getall do if getall[i].ClassName == "Part" then wait(1) clonep = P:clone() clonep.Parent = game.Workspace clonep.Position = Vector3.new(math.random(0, 50), math.random(0,50), math.random(0, 50)) clonep:MakeJoints() end end end end
brick.Touched:connect(cloneall)
This is the current output
"Workspace.clone Brick.Clone me:12: attempt to index local 'clonep' (a nil value)"
|
|
|
| Report Abuse |
|
|
|
| 10 Aug 2012 03:27 AM |
Try using a local script and use this:
guy = game.Workspace.Player getall = game.Workspace:GetChildren() brick = script.Parent
function cloneall(hit) hum = hit.Parent:FindFirstChild("Humanoid") if hum ~= nil and hum == guy.Humanoid then for i = 1, #getall do if getall[i].ClassName == "Part" then wait(1) local clone = guy:Clone() clone.Parent = game.Workspace clone.Position = Vector3.new(math.random(0, 50), math.random(0,50), math.random(0, 50)) clone:MakeJoints() end end end end
brick.Touched:connect(cloneall) |
|
|
| Report Abuse |
|
|