SuperfryxJoin Date: 2011-08-01 Post Count: 3253 |
I am making a game, and I need to type in a command so I can move some parts into a model. I want to move all parts named WoodWall in a model named Map, to a model in Map called WoodWallModel
----Where all the parts are----
Map=game.Workspace
All the wood walls=Map
WoodWallModel=Map
~local Superfryx=game.Workspace.Awesomeness |
|
smiley599Join Date: 2010-01-23 Post Count: 21869 |
player added
chatted
if message is something
clone to workspace |
|
SuperfryxJoin Date: 2011-08-01 Post Count: 3253 |
I ment the command line in studio.
~local Superfryx=game.Workspace.Awesomeness |
|
SuperfryxJoin Date: 2011-08-01 Post Count: 3253 |
meant*
~local Superfryx=game.Workspace.Awesomeness |
|
|
for _,v in pairs(workspace:GetChildren()) do
if v.Name == "WoodWall" then
v.Parent = workspace.ModelName
end
end |
|
128GBJoin Date: 2014-04-17 Post Count: 8056 |
Map=game.Workspace
All the wood walls=Map
WoodWallModel=Map
for _, v in pairs (Workspace.Map:GetChildren()) do
if v.Name == "WoodWall" then
v.Parent = Workspace.Map.WoodWallModel
end
end |
|
KEVEKEV77Join Date: 2009-03-12 Post Count: 6961 |
function _G.Move(part, model)
part.Parent = model;
end
so in command bar, write this
_G.Move(game.Workspace.THEPART, game.Workspace.THEMODEL);
|
|
128GBJoin Date: 2014-04-17 Post Count: 8056 |
Ignore the top lines I copied them into my post to remember where everything was parented and meant to remove them |
|
KEVEKEV77Join Date: 2009-03-12 Post Count: 6961 |
so with my function,
for i,v in pairs(game.Workspace:GetChildren()) do
if v.Name == "NAMEHERE" then
_G.Move(game.Workspace.THEPART, WoodWallModel);
end |
|
128GBJoin Date: 2014-04-17 Post Count: 8056 |
_G.Move
Unneeded _G. function is unneeded |
|
SuperfryxJoin Date: 2011-08-01 Post Count: 3253 |
Thanks guys!
~local Superfryx=game.Workspace.Awesomeness |
|
KEVEKEV77Join Date: 2009-03-12 Post Count: 6961 |
@128 unneeded unused definitions are unneeded |
|
|
bumping dis is uneeded bumping is uneeded. |
|
KEVEKEV77Join Date: 2009-03-12 Post Count: 6961 |
well actually, a _G is needed when using it in a command bar.
So hah! |
|
128GBJoin Date: 2014-04-17 Post Count: 8056 |
No its not |
|
KEVEKEV77Join Date: 2009-03-12 Post Count: 6961 |
try it. |
|
cntkillmeJoin Date: 2008-04-07 Post Count: 49450 |
function Move(part, model)
part.Parent = model;
end
Move(game.Workspace.THEPART, game.Workspace.THEMODEL);
works fine... |
|
KEVEKEV77Join Date: 2009-03-12 Post Count: 6961 |
weird, not for me >.< |
|
128GBJoin Date: 2014-04-17 Post Count: 8056 |
https://www.youtube.com/watch?v=-N-ZjJn2x1Y |
|
cntkillmeJoin Date: 2008-04-07 Post Count: 49450 |
lol I love your videos, 5/5 |
|