RoKjell
|
  |
| Joined: 22 Nov 2012 |
| Total Posts: 1205 |
|
|
| 24 Jul 2015 06:01 PM |
Why doesn't this clone part work?
This script is actually bigger and I use :clone() more times where it works, it just doesn't work here. idk why tho.
local playrs = game.Players:GetChildren() function ChooseSpawn() spawnvalue = game.ServerStorage.Values.Spawns spawnclonevalue = game.ServerStorage.Values.Spawnsclone spawnvalue:GetChildren():Clone().Parent = spawnclonevalue for i = 1, #playrs do local spawnchosen = spawnclonevalue[math.random(1, #spawnclonevalue)] spawnchosen.Parent = game.ServerStorage.ChosenSpawns.Spawns spawnchosen:remove() print (playrs.Name.." spawns on " ..spawnchosen) end spawnclonevalue:GetChildren():remove()
end
error: Workspace.WorkingScript:13: attempt to call method 'clone' (a nil value)
--RoKjell-- |
|
|
| Report Abuse |
|
|
|
| 24 Jul 2015 06:05 PM |
spawnvalue:GetChildren():Clone()
GetChildren returns a table. The table does not a function named Clone in it. |
|
|
| Report Abuse |
|
|
RoKjell
|
  |
| Joined: 22 Nov 2012 |
| Total Posts: 1205 |
|
|
| 24 Jul 2015 06:08 PM |
I know it's that part that doesn't make it work, that's the clone part but is there a way to make it work? I tried to figure it out but I don't know how to, I always used this way for things without GetChildren
--RoKjell-- |
|
|
| Report Abuse |
|
|
|
| 24 Jul 2015 06:11 PM |
| Are you trying to clone all of the children of spawnvalue into spawnclonevalue? |
|
|
| Report Abuse |
|
|
RoKjell
|
  |
| Joined: 22 Nov 2012 |
| Total Posts: 1205 |
|
|
| 24 Jul 2015 06:14 PM |
Yeah, that's why I used GetChildren but I forgot that's a Read-Only thing.
--RoKjell-- |
|
|
| Report Abuse |
|
|
|
| 24 Jul 2015 06:16 PM |
GetChildren isn't read-only.
You could do for _, c in pairs(spawnvalue:GetChildren()) do c:Clone().Parent = spawnclonevalue; end |
|
|
| Report Abuse |
|
|
RoKjell
|
  |
| Joined: 22 Nov 2012 |
| Total Posts: 1205 |
|
|
| 24 Jul 2015 06:28 PM |
Objects GetChildren() Member of Instance Summary: Returns a read-only table of this Object's children
--RoKjell-- |
|
|
| Report Abuse |
|
|
|
| 24 Jul 2015 06:31 PM |
| That's poorly worded. The table can be modified but the changes won't affect the children. |
|
|
| Report Abuse |
|
|
RoKjell
|
  |
| Joined: 22 Nov 2012 |
| Total Posts: 1205 |
|
|
| 24 Jul 2015 06:37 PM |
Well, it's from the object browser :p
--RoKjell-- |
|
|
| Report Abuse |
|
|
RoKjell
|
  |
| Joined: 22 Nov 2012 |
| Total Posts: 1205 |
|
|
| 24 Jul 2015 06:41 PM |
Ooh btw, you accidently used ; after a line, I also almost made that mistake today, I know you know it isn't used in Lua tho
--RoKjell-- |
|
|
| Report Abuse |
|
|
RoKjell
|
  |
| Joined: 22 Nov 2012 |
| Total Posts: 1205 |
|
|
| 24 Jul 2015 06:44 PM |
And as last this part:
for i = 1, #playrs do local spawnchosen = spawnclonevalue[math.random(1, #spawnclonevalue)] spawnchosen.Parent = game.ServerStorage.ChosenSpawns.Spawns spawnchosen:remove() print (playrs.Name.." spawns on " ..spawnchosen) end
has as error: Workspace.WorkingScript:17: attempt to get length of global 'spawnclonevalue' (a userdata value)
--RoKjell-- |
|
|
| Report Abuse |
|
|
RoKjell
|
  |
| Joined: 22 Nov 2012 |
| Total Posts: 1205 |
|
|
| 24 Jul 2015 06:55 PM |
I added :GetChildren to it so it's:
for i = 1, #playrs do local spawnchosen = spawnclonevalue[math.random(1, #spawnclonevalue:GetChildren)] spawnchosen.Parent = game.ServerStorage.ChosenSpawns.Spawns spawnchosen:remove() print (playrs.Name.." spawns on " ..spawnchosen) end
but it now gives this error: 1 is not a valid member of StringValue
--RoKjell-- |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 24 Jul 2015 06:57 PM |
http://wiki.roblox.com/index.php?title=Absolute_beginner%27s_guide_to_scripting
"Talk is cheap. Show me the code." - Linus Torvalds |
|
|
| Report Abuse |
|
|
RoKjell
|
  |
| Joined: 22 Nov 2012 |
| Total Posts: 1205 |
|
|
| 24 Jul 2015 07:01 PM |
Dude, I know how to script, I'm a really good scripter, this are just 2 things I never had to use before and I have to use now, don't hate m8, just get away if you're here to hate.
--RoKjell-- |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 24 Jul 2015 07:02 PM |
I'm not hating. I'm simply laughing at how easy this is and the fact that you don't understand it.
"Talk is cheap. Show me the code." - Linus Torvalds |
|
|
| Report Abuse |
|
|
RoKjell
|
  |
| Joined: 22 Nov 2012 |
| Total Posts: 1205 |
|
|
| 24 Jul 2015 07:04 PM |
If it's easy, solve it .. but ooh yeah, you can't. and it is hating dude.
--RoKjell-- |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 24 Jul 2015 07:05 PM |
Like I said before, there is a difference between hating something and having humor at something silly.
"Talk is cheap. Show me the code." - Linus Torvalds |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 24 Jul 2015 07:07 PM |
Oh yeah and this is nothing. i'm pretty sure I know 99% more than you know anything about what scripting even is.
"Talk is cheap. Show me the code." - Linus Torvalds |
|
|
| Report Abuse |
|
|
RoKjell
|
  |
| Joined: 22 Nov 2012 |
| Total Posts: 1205 |
|
|
| 24 Jul 2015 07:07 PM |
It's pretty easy to not reply to a forum if you're here to laugh, are you a cuber bully hmm? Because laughint at someone on the computer is part of that.
--RoKjell-- |
|
|
| Report Abuse |
|
|
| |
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 24 Jul 2015 07:09 PM |
( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)
"Talk is cheap. Show me the code." - Linus Torvalds |
|
|
| Report Abuse |
|
|
RoKjell
|
  |
| Joined: 22 Nov 2012 |
| Total Posts: 1205 |
|
|
| 24 Jul 2015 07:11 PM |
| Yup, a cyber bully, so you get bullied irl and try to look better on the internet |
|
|
| Report Abuse |
|
|
RoKjell
|
  |
| Joined: 22 Nov 2012 |
| Total Posts: 1205 |
|
|
| 24 Jul 2015 07:12 PM |
| It's also funny how you can't even solve it |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 24 Jul 2015 07:12 PM |
∧__∧ ( ͡° ͜ʖ ͡°) ⊂ つ (つ ノ (ノ \ ☆ | ☆ (⌒ ⌒ヽ / \ (´⌒ ⌒ ⌒ヾ (’⌒ ; ⌒ ::⌒ ) (´ ) ::: ) ☆─ (´⌒;: ::⌒`) :; ) (⌒:: :: ::⌒ ) ( ゝ ヾ 丶 ソ ─
( ͡° ͜ʖ ͡°): Man I totally ( ͡• ͜ʖ ͡•) thatand then she went ( ͡° ͜ʖ ͡°) and then we like ( ͡° ͜ʖ ͡°) all ( ͡° ͜ʖ ͡°).
( ͡° ͜ʖ ͡°): Cool man, I ( ͡° ͜ʖ ͡°) there and ( ͡° ͜ʖ ͡°) you know and ( ͡° ͜ʖ ͡°) and ( ͡° ͜ʖ ͡°).
"Talk is cheap. Show me the code." - Linus Torvalds |
|
|
| Report Abuse |
|
|
instawin
|
  |
| Joined: 04 Jun 2013 |
| Total Posts: 8777 |
|
|
| 24 Jul 2015 07:14 PM |
@OP
what are you trying to do? |
|
|
| Report Abuse |
|
|