AkatUmeJoin Date: 2012-03-04 Post Count: 2497 |
I thought this would work, but when I tested it in studio, it wouldn't.
local me = Workspace.PlumJar
me:MoveTo(Vector3.new(game.Workspace.Brick.Position))
Can someone tell me how I can make this work?
Thanks for helping!
Bu-Bump. |
|
AkatUmeJoin Date: 2012-03-04 Post Count: 2497 |
Bu-Bump. |
|
cntkillmeJoin Date: 2008-04-07 Post Count: 49450 |
Make sure you run it after you joined, and remove the Vector3.new since the Position property returns a Vector3 |
|
AkatUmeJoin Date: 2012-03-04 Post Count: 2497 |
So it should be
local me = Workspace.PlumJar
me:MoveTo(game.Workspace.Brick.Position)
?
Bu-Bump. |
|
AkatUmeJoin Date: 2012-03-04 Post Count: 2497 |
Bump-a-de bump bump.
Bu-Bump. |
|
cntkillmeJoin Date: 2008-04-07 Post Count: 49450 |
yes |
|
DevVinceJoin Date: 2008-11-08 Post Count: 9245 |
function walk_to_thing(part)
if Workspace.PlumJar:FindFirstChild'Humanoid' then
Workspace.PlumJar.Humanoid:MoveTo(part.Position)
end
walk_to_thing(game.Workspace.Brick)--This will fire the function
--Might or might not work haven't worked with MoveTo for a while so idk.
|
|
DevVinceJoin Date: 2008-11-08 Post Count: 9245 |
Wait are you trying to have it teleport or have you walk to it? |
|
AkatUmeJoin Date: 2012-03-04 Post Count: 2497 |
Teleport
Bu-Bump. |
|
FlyScriptJoin Date: 2010-08-05 Post Count: 3008 |
You realise that in studio you're called Player1, not your username, right?
Also, if you want to teleport just set your torso's CFrame to the CFrame of where you want to teleport to.
【◄[ϟ]〓☜✪ xWOWZABOYx; FCOM, SQN COM, Scientist, Veteran, Visionary ✪☞〓[ϟ]►】 |
|
DevVinceJoin Date: 2008-11-08 Post Count: 9245 |
Cframe and moveto both work for teleporting. MoveTo is just a newer method for it. :P |
|
AkatUmeJoin Date: 2012-03-04 Post Count: 2497 |
@xWoW: Yes I know i'm named Player1, using"PlumJar" was just an example.
Also I want to move other models too, not just characters so CFrame wont work, will it? (<--Serious Q there)
Bu-Bump. |
|
FlyScriptJoin Date: 2010-08-05 Post Count: 3008 |
It should do if all parts are welded/connected via motors to the part that you're altering the CFrame of.
No surfacemotors/hinges tho
【◄[ϟ]〓☜✪ xWOWZABOYx; FCOM, SQN COM, Scientist, Veteran, Visionary ✪☞〓[ϟ]►】 |
|
DevVinceJoin Date: 2008-11-08 Post Count: 9245 |
--This was from another post but will help you get the idea. (This will make it move slowly)
function a()
for _,v in pairs(script.Parent:GetChildren()) do--Put the script in the model. :P
if v:IsA'Part' then
v.Anchored = true
--Add your Cframe line(s) here.(got lazy soz) :P
end end end
for i = 1,20 do
wait()a()
end |
|
AkatUmeJoin Date: 2012-03-04 Post Count: 2497 |
@Above But that wont make it teleport, will it?
Bu-Bump. |
|
DevVinceJoin Date: 2008-11-08 Post Count: 9245 |
You can edit it to make the model teleport. |
|
AkatUmeJoin Date: 2012-03-04 Post Count: 2497 |
I guess what i'm asking is, how can you use :MoveTo without directly entering a Vector3, but instead typing something like brick.Position
Bu-Bump. |
|
DevVinceJoin Date: 2008-11-08 Post Count: 9245 |
--Now it should teleport the model. :P
--(If your doing it with a player just Cframe the player's Torso.)
for _,v in pairs(script.Parent:GetChildren()) do--Put the script in the model. :P
if v:IsA'Part' then
v.Anchored = true
--Add your Cframe line(s) here.(got lazy soz) :P
end end |
|
cntkillmeJoin Date: 2008-04-07 Post Count: 49450 |
local me = Workspace.PlumJar --make sure this exists and is correct
me:MoveTo(game.Workspace.Brick.Position) |
|
FlyScriptJoin Date: 2010-08-05 Post Count: 3008 |
It should do if all parts are welded/connected via motors to the part that you're altering the CFrame of.
No surfacemotors/hinges tho
【◄[ϟ]〓☜✪ xWOWZABOYx; FCOM, SQN COM, Scientist, Veteran, Visionary ✪☞〓[ϟ]►】 |
|
DevVinceJoin Date: 2008-11-08 Post Count: 9245 |
Try:
function a(move,to)
--move = the item you want to move then to = brick/pos you want it to move to
move:MoveTo(Vector3.new(to.Position))
end
a(game.Workspace.part1,game.Workspace.part5)--Something like that. |
|
AkatUmeJoin Date: 2012-03-04 Post Count: 2497 |
Ooooh.. I see! Thanks you guys! I really appreciate it!
Bu-Bump. |
|
DevVinceJoin Date: 2008-11-08 Post Count: 9245 |
No problem, goodnight it's about time I head to bed. |
|