|
| 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 |
|
|
|
| 03 Sep 2013 01:01 PM |
try this
model:MoveTo(Vector3.new(0,1,0)+workspace['Garage'..tm].Bottom.Position) |
|
|
| Report Abuse |
|
|
|
| 03 Sep 2013 01:02 PM |
Finally an answer. Thanks a lot :D I'll try now. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
| |
|
|
| 03 Sep 2013 01:17 PM |
no, it didn't... What the... |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 03 Sep 2013 01:20 PM |
| I'll try now, but I don't think that will fix anything. |
|
|
| Report Abuse |
|
|
| |
|
|
| 03 Sep 2013 01:34 PM |
| It's in a script, not a localscript. And I'm testing it online |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 03 Sep 2013 01:40 PM |
Magna, what does that mean.
You mean I should put everything into a LocalScript? |
|
|
| Report Abuse |
|
|
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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 04 Sep 2013 06:40 AM |
| Soquick, I already told you that this is PART of a script. |
|
|
| Report Abuse |
|
|
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 |
|
|