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: Script failed, help!

Previous Thread :: Next Thread 
MattMini112 is not online. MattMini112
Joined: 06 Jul 2012
Total Posts: 56
16 Jul 2013 12:41 AM
I Was using this script that I partly edited and it was ment to insert a model into the game at a certain position, but it didn't work, can someone fix it up for me?


asset = 122830184 --Insert The ID Of The Model Here
model = game:GetService("InsertService"):LoadAsset(asset)
model.Parent = game.Workspace
model:MakeJoints()
model.Name = "b"..asset
game.b.Position = -577.641, 1.3, -340.74


This is what showed up in the output when I hit the play button:

17:35:49.984 - B is not a valid member of DataModel
17:35:49.985 - Script "Workspace.Insert Script", Line 13
17:35:49.986 - stack end
Report Abuse
MattMini112 is not online. MattMini112
Joined: 06 Jul 2012
Total Posts: 56
16 Jul 2013 12:42 AM
Bump
Report Abuse
MattMini112 is not online. MattMini112
Joined: 06 Jul 2012
Total Posts: 56
16 Jul 2013 12:48 AM
Bump 2
Report Abuse
baheeg is not online. baheeg
Joined: 19 Jul 2010
Total Posts: 72846
16 Jul 2013 12:52 AM
[ Content Deleted ]
Report Abuse
MattMini112 is not online. MattMini112
Joined: 06 Jul 2012
Total Posts: 56
16 Jul 2013 12:53 AM
Bump 3 .-.
Report Abuse
MattMini112 is not online. MattMini112
Joined: 06 Jul 2012
Total Posts: 56
16 Jul 2013 12:55 AM
Read the whole thing through, I Put what the output window said AND What I wanted it to do.. If you read it all the way through .-.
Report Abuse
baheeg is not online. baheeg
Joined: 19 Jul 2010
Total Posts: 72846
16 Jul 2013 12:55 AM
[ Content Deleted ]
Report Abuse
baheeg is not online. baheeg
Joined: 19 Jul 2010
Total Posts: 72846
16 Jul 2013 12:58 AM
[ Content Deleted ]
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
16 Jul 2013 01:00 AM
Erroring line: game.b.Position = -577.641, 1.3, -340.74
Issues:
game.b does not exist.
Position is a Vector3 value.

Solution (assuming that that was the only line with an issue...):
model:MoveTo(Vector3.new(-577.641,1.3,-340.74))
Report Abuse
baheeg is not online. baheeg
Joined: 19 Jul 2010
Total Posts: 72846
16 Jul 2013 01:00 AM
[ Content Deleted ]
Report Abuse
baheeg is not online. baheeg
Joined: 19 Jul 2010
Total Posts: 72846
16 Jul 2013 01:01 AM
[ Content Deleted ]
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
16 Jul 2013 01:01 AM
Baheeg, you can use the 'model' variable that he created.
Also, Vector3 is not a child or property of Position.
'b' still doesn't exist inside of game.
His model is in Workspace (or game.Workspace), not in 'game'.
Report Abuse
baheeg is not online. baheeg
Joined: 19 Jul 2010
Total Posts: 72846
16 Jul 2013 01:04 AM
[ Content Deleted ]
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
16 Jul 2013 01:13 AM
'model' is a variable. Names are strings.
'model' was not Parented it to game, it was Parented to Workspace.

http://wiki.roblox.com/index.php/Variables

game.b122830184.Position.Vector3.new
That is what you used when attempting to set the Position property.
game.b122830184 does not exist.
Also, if it DID exist, it would error because you're trying to access a property or child of the Position property called 'Vector3', which doesn't exist.
You set the position TO a Vector3.

Finally, if what was added was not a BasePart (which has the Position property), but a Model, Hat, Tool (etcetera), then it wouldn't work. Because of this, you should try to use the MoveTo method.
Report Abuse
baheeg is not online. baheeg
Joined: 19 Jul 2010
Total Posts: 72846
16 Jul 2013 01:14 AM
[ Content Deleted ]
Report Abuse
baheeg is not online. baheeg
Joined: 19 Jul 2010
Total Posts: 72846
16 Jul 2013 01:15 AM
[ Content Deleted ]
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
16 Jul 2013 01:16 AM
Read the wiki page.

I didn't say 'game.Workspace.Model', I said 'model'.
'model' is a variable that he defined. It refers to it, no matter what the name is.
Report Abuse
MattMini112 is not online. MattMini112
Joined: 06 Jul 2012
Total Posts: 56
16 Jul 2013 01:17 AM
Yeah, I wondered why the model wouldn't move to the set position, It just spawned in at sat there. Can you edit the script to use the move to method?
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
16 Jul 2013 01:18 AM
Replace your positioning line with the one that I gave you.
model:MoveTo(Vector3.new(-577.641,1.3,-340.74))
Report Abuse
baheeg is not online. baheeg
Joined: 19 Jul 2010
Total Posts: 72846
16 Jul 2013 01:18 AM
[ Content Deleted ]
Report Abuse
MattMini112 is not online. MattMini112
Joined: 06 Jul 2012
Total Posts: 56
16 Jul 2013 01:20 AM
You're the best. Thanks man.
Report Abuse
lordsheen is not online. lordsheen
Joined: 24 Oct 2008
Total Posts: 608
16 Jul 2013 01:22 AM
asset = 122830184 --Insert The ID Of The Model Here
model = game:GetService("InsertService"):LoadAsset(asset)
model.Parent = game.Workspace
model:MakeJoints()
model.Name = "b"
model:MoveTo(Vector3.new(-577.641, 1.3, -340.74))

This thread replies were painful to read.
Report Abuse
MattMini112 is not online. MattMini112
Joined: 06 Jul 2012
Total Posts: 56
16 Jul 2013 01:29 AM
Thanks lord, now I don't have any annoying numbers :P
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