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: Model:MoveTo doesn't work

Previous Thread :: Next Thread 
XxSpyDudexX is not online. XxSpyDudexX
Joined: 04 Jan 2009
Total Posts: 2003
03 Sep 2013 12:48 PM
This is part of the script that loads a model and teleports it to a position.
There's nothing in the output, and the script works pretty fine, with one exception. It doesn't move the model.

script.Parent.Parent.Parent.Parent.Parent:WaitForDataReady()
local model = script.Parent.Parent.Parent.Parent.Parent:LoadInstance("Mech1")
if model ~= nil then
local c = workspace:GetChildren()
for i=1, #c do
if c[i].Name == ("part"..tm) then
c[i]:remove()
end
end
model:MoveTo(workspace['Garage'..tm].Bottom.Position + Vector3.new(0,1,0))
Report Abuse
meSmashsta is not online. meSmashsta
Joined: 31 Jan 2013
Total Posts: 1002
03 Sep 2013 01:01 PM
try this

model:MoveTo(Vector3.new(0,1,0)+workspace['Garage'..tm].Bottom.Position)
Report Abuse
XxSpyDudexX is not online. XxSpyDudexX
Joined: 04 Jan 2009
Total Posts: 2003
03 Sep 2013 01:02 PM
Finally an answer. Thanks a lot :D
I'll try now.
Report Abuse
meSmashsta is not online. meSmashsta
Joined: 31 Jan 2013
Total Posts: 1002
03 Sep 2013 01:04 PM
if that wont do it then try this one

model:MoveTo(Vector3.new(0+workspace['Garage'..tm].Bottom.Position.X,1+workspace['Garage'..tm].Bottom.Position.Y,0+workspace['Garage'..tm].Bottom.Position.Z))
Report Abuse
meSmashsta is not online. meSmashsta
Joined: 31 Jan 2013
Total Posts: 1002
03 Sep 2013 01:08 PM
did it work?
Report Abuse
XxSpyDudexX is not online. XxSpyDudexX
Joined: 04 Jan 2009
Total Posts: 2003
03 Sep 2013 01:17 PM
no, it didn't...
What the...
Report Abuse
meSmashsta is not online. meSmashsta
Joined: 31 Jan 2013
Total Posts: 1002
03 Sep 2013 01:19 PM
did this one worked?

model:MoveTo(Vector3.new(0+workspace['Garage'..tm].Bottom.Position.X,1+workspace['Garage'..tm].Bottom.Position.Y,0+workspace['Garage'..tm].Bottom.Position.Z))
Report Abuse
magnalite is not online. magnalite
Joined: 18 Oct 2009
Total Posts: 2467
03 Sep 2013 01:20 PM
Are you running this on a roblox server or locally? Also is it in a localscript?
Report Abuse
XxSpyDudexX is not online. XxSpyDudexX
Joined: 04 Jan 2009
Total Posts: 2003
03 Sep 2013 01:20 PM
I'll try now, but I don't think that will fix anything.
Report Abuse
meSmashsta is not online. meSmashsta
Joined: 31 Jan 2013
Total Posts: 1002
03 Sep 2013 01:30 PM
did it work?
Report Abuse
XxSpyDudexX is not online. XxSpyDudexX
Joined: 04 Jan 2009
Total Posts: 2003
03 Sep 2013 01:34 PM
It's in a script, not a localscript. And I'm testing it online
Report Abuse
meSmashsta is not online. meSmashsta
Joined: 31 Jan 2013
Total Posts: 1002
03 Sep 2013 01:35 PM
well this is hard, a player released a gui that shows you the script error when you test online, you should find that model and use it in your place since your using save and load method.
Report Abuse
magnalite is not online. magnalite
Joined: 18 Oct 2009
Total Posts: 2467
03 Sep 2013 01:38 PM
--script.Parent.Parent.Parent.Parent.Parent:WaitForDataReady()
local model = script.Parent.Parent.Parent.Parent.Parent:LoadInstance("Mech1")
if model ~= nil then
local c = workspace:GetChildren()
for i=1, #c do
if c[i].Name == ("part"..tm) then
c[i]:remove()
end
end
model:MoveTo(workspace['Garage'..tm].Bottom.Position + Vector3.new(0,1,0))

Learn your api.

Data persistence only works in localscripts.
Report Abuse
XxSpyDudexX is not online. XxSpyDudexX
Joined: 04 Jan 2009
Total Posts: 2003
03 Sep 2013 01:40 PM
Magna, what does that mean.

You mean I should put everything into a LocalScript?
Report Abuse
magnalite is not online. magnalite
Joined: 18 Oct 2009
Total Posts: 2467
03 Sep 2013 01:41 PM
It means you should only use data persistence in local scripts.
Report Abuse
magnalite is not online. magnalite
Joined: 18 Oct 2009
Total Posts: 2467
03 Sep 2013 01:43 PM
Ok no I'm an idiot ignore what I said.
Report Abuse
XxSpyDudexX is not online. XxSpyDudexX
Joined: 04 Jan 2009
Total Posts: 2003
03 Sep 2013 01:53 PM
On wiki it says you can only access data persistence with a script, not lscript

But why doesn't the model move D:
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
03 Sep 2013 02:00 PM
script.Parent.Parent.Parent.Parent.Parent:WaitForDataReady()
local model = script.Parent.Parent.Parent.Parent.Parent:LoadInstance("Mech1")
if model ~= nil then
local c = workspace:GetChildren()
for i=1, #c do
if c[i].Name == ("part"..tm) then
c[i]:remove()
end
end
model:MoveTo(workspace['Garage'..tm].Bottom.Position + Vector3.new(0,1,0))
NO TM defined...
Report Abuse
XxSpyDudexX is not online. XxSpyDudexX
Joined: 04 Jan 2009
Total Posts: 2003
04 Sep 2013 06:40 AM
Soquick, I already told you that this is PART of a script.
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
04 Sep 2013 01:58 PM
script.Parent.Parent.Parent.Parent.Parent:WaitForDataReady()
local model = script.Parent.Parent.Parent.Parent.Parent:LoadInstance("Mech1")
if model ~= nil then
for i,v in pairs(workspace:children()) do
if v.Name:lower() == tostring("part"..tm) then
v:remove()
end
end
model:MoveTo(workspace[tostring('Garage'..tm)].Bottom.Position + Vector3.new(0,1,0))
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