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: Clone script help

Previous Thread :: Next Thread 
StickyPigeon is not online. StickyPigeon
Joined: 29 Feb 2012
Total Posts: 40
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
StickyPigeon is not online. StickyPigeon
Joined: 29 Feb 2012
Total Posts: 40
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
StickyPigeon is not online. StickyPigeon
Joined: 29 Feb 2012
Total Posts: 40
09 Aug 2012 10:44 PM
bump
Report Abuse
StickyPigeon is not online. StickyPigeon
Joined: 29 Feb 2012
Total Posts: 40
09 Aug 2012 10:52 PM
Anyone? Anyone please?
Report Abuse
StickyPigeon is not online. StickyPigeon
Joined: 29 Feb 2012
Total Posts: 40
09 Aug 2012 11:07 PM
Bump. Why is everyone ignoring my script -_-
Report Abuse
StickyPigeon is not online. StickyPigeon
Joined: 29 Feb 2012
Total Posts: 40
09 Aug 2012 11:19 PM
Bumpo
Report Abuse
StickyPigeon is not online. StickyPigeon
Joined: 29 Feb 2012
Total Posts: 40
10 Aug 2012 12:36 AM
bump
Report Abuse
LordStriked is not online. LordStriked
Joined: 19 Mar 2011
Total Posts: 5396
10 Aug 2012 12:37 AM
Not enough ends?

- Striked
Report Abuse
StickyPigeon is not online. StickyPigeon
Joined: 29 Feb 2012
Total Posts: 40
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
AprilFirst is not online. AprilFirst
Joined: 19 Jul 2012
Total Posts: 186
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
StickyPigeon is not online. StickyPigeon
Joined: 29 Feb 2012
Total Posts: 40
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
StickyPigeon is not online. StickyPigeon
Joined: 29 Feb 2012
Total Posts: 40
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
xXTheRobotXxAlt is not online. xXTheRobotXxAlt
Joined: 06 Jul 2012
Total Posts: 548
10 Aug 2012 02:17 AM
Try putting local clonep at line 12,
Report Abuse
StickyPigeon is not online. StickyPigeon
Joined: 29 Feb 2012
Total Posts: 40
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
xXTheRobotXxAlt is not online. xXTheRobotXxAlt
Joined: 06 Jul 2012
Total Posts: 548
10 Aug 2012 02:21 AM
I will see what i can do.
Report Abuse
xXTheRobotXxAlt is not online. xXTheRobotXxAlt
Joined: 06 Jul 2012
Total Posts: 548
10 Aug 2012 02:23 AM
First line is messed up...
Report Abuse
StickyPigeon is not online. StickyPigeon
Joined: 29 Feb 2012
Total Posts: 40
10 Aug 2012 02:30 AM
The P variable?
Report Abuse
xXTheRobotXxAlt is not online. xXTheRobotXxAlt
Joined: 06 Jul 2012
Total Posts: 548
10 Aug 2012 02:31 AM
"Player is not a valid member of workspace"
Report Abuse
StickyPigeon is not online. StickyPigeon
Joined: 29 Feb 2012
Total Posts: 40
10 Aug 2012 02:38 AM
Are you testing solo?
Report Abuse
xXTheRobotXxAlt is not online. xXTheRobotXxAlt
Joined: 06 Jul 2012
Total Posts: 548
10 Aug 2012 02:39 AM
Oh, thats why.
Report Abuse
StickyPigeon is not online. StickyPigeon
Joined: 29 Feb 2012
Total Posts: 40
10 Aug 2012 02:40 AM
Any success?
Report Abuse
StickyPigeon is not online. StickyPigeon
Joined: 29 Feb 2012
Total Posts: 40
10 Aug 2012 03:03 AM
bump
Report Abuse
Spongocardo is not online. Spongocardo
Joined: 06 Sep 2008
Total Posts: 2843
10 Aug 2012 03:09 AM
Are you using a local script or a regular one?
Report Abuse
StickyPigeon is not online. StickyPigeon
Joined: 29 Feb 2012
Total Posts: 40
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
Spongocardo is not online. Spongocardo
Joined: 06 Sep 2008
Total Posts: 2843
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
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