RobuxLife
|
  |
| Joined: 19 Sep 2012 |
| Total Posts: 13336 |
|
|
| 20 Dec 2014 10:49 AM |
Service1 = game:GetService("InsertService") Service2 = game:GetService("BadgeService") GUI = script.Parent.Parent.Parent.Parent
script.Parent.MouseButton1Click:connect(function() local Player = script.Parent.Parent.Parent.Parent.Parent.Parent local Label = Player.PlayerGui.CargoGUI.Information if workspace:FindFirstChild(Player.Name.." Truck") == nil then local model = Service1:LoadAsset(script.ID.Value) local TruckName = script.Parent.Parent.Parent.NameLabel.Text model.Name = Player.Name.." Truck" model.Model.VehicleSeat.Vars.Owner.Value = Player.Name local tab = Service1:Insert(model) model:MoveTo(workspace:FindFirstChild("Regen"..GUI.Regen.Value).Pos.Position + Vector3.new(0,5,0)) Label.Text = TruckName.." spawned." GUI:Remove() else Label.Text = "Delete your old truck first!" end end) |
|
|
| Report Abuse |
|
|
|
| 20 Dec 2014 10:52 AM |
What is the error if I may ask?
I can't really help you when I don't know the error. |
|
|
| Report Abuse |
|
|
RobuxLife
|
  |
| Joined: 19 Sep 2012 |
| Total Posts: 13336 |
|
|
| 20 Dec 2014 10:55 AM |
When I click the Spawn button, the truck/car won't even spawn. The error says in output everytime I click says: 11:56:50.024 - Model is not a valid member of Model 11:56:50.025 - Script 'Players.Player.PlayerGui.NewTruckSpawnGUI.TruckInfo.InfoBox', Line 13 11:56:50.025 - Stack End |
|
|
| Report Abuse |
|
|
RobuxLife
|
  |
| Joined: 19 Sep 2012 |
| Total Posts: 13336 |
|
| |
|
RobuxLife
|
  |
| Joined: 19 Sep 2012 |
| Total Posts: 13336 |
|
|
| 20 Dec 2014 11:00 AM |
| Help. I might 3v3n pay, okay? |
|
|
| Report Abuse |
|
|
RobuxLife
|
  |
| Joined: 19 Sep 2012 |
| Total Posts: 13336 |
|
| |
|
RobuxLife
|
  |
| Joined: 19 Sep 2012 |
| Total Posts: 13336 |
|
|
| 20 Dec 2014 11:11 AM |
| Come on, if you guys can script than this should be easy to ya :/ |
|
|
| Report Abuse |
|
|
RobuxLife
|
  |
| Joined: 19 Sep 2012 |
| Total Posts: 13336 |
|
| |
|
RobuxLife
|
  |
| Joined: 19 Sep 2012 |
| Total Posts: 13336 |
|
| |
|
Argelius
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 4047 |
|
|
| 20 Dec 2014 11:35 AM |
The error is saying that the model you are inserting doesn't contain anything called "Model". try this as line 13:
model.VehicleSeat.Vars.Owner.Value = Player.Name |
|
|
| Report Abuse |
|
|
RobuxLife
|
  |
| Joined: 19 Sep 2012 |
| Total Posts: 13336 |
|
|
| 20 Dec 2014 11:38 AM |
Now it says 12:39:35.812 - VehicleSeat is not a valid member of Model 12:39:35.813 - Script 'Players.Player.PlayerGui.NewTruckSpawnGUI.TruckInfo.InfoBox', Line 13 12:39:35.814 - Stack End |
|
|
| Report Abuse |
|
|
Argelius
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 4047 |
|
|
| 20 Dec 2014 11:41 AM |
do this to see what /is/ a valid member of Model
13: for i = 1, #model do 14: print(model[i].Name) 15: end
then check output |
|
|
| Report Abuse |
|
|
Argelius
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 4047 |
|
|
| 20 Dec 2014 11:45 AM |
I meant to type modelitems = model:GetChildren() for i=1,#modelitems do print(modelitems[i].Name) end |
|
|
| Report Abuse |
|
|
RobuxLife
|
  |
| Joined: 19 Sep 2012 |
| Total Posts: 13336 |
|
|
| 20 Dec 2014 11:45 AM |
| Players.Player.PlayerGui.NewTruckSpawnGUI.TruckInfo.InfoBox:13: attempt to get length of local 'model' (a userdata value) |
|
|
| Report Abuse |
|
|
RobuxLife
|
  |
| Joined: 19 Sep 2012 |
| Total Posts: 13336 |
|
|
| 20 Dec 2014 11:48 AM |
| Do ya just want the model so you can work on it? I'm horrible at this :P |
|
|
| Report Abuse |
|
|
Argelius
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 4047 |
|
|
| 20 Dec 2014 11:48 AM |
Do the second one not the first one I posted
Also, remember that you can only insert items in your inventory or ROBLOX's inventory |
|
|
| Report Abuse |
|
|
Argelius
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 4047 |
|
|
| 20 Dec 2014 11:49 AM |
| What model are you trying to insert? |
|
|
| Report Abuse |
|
|
RobuxLife
|
  |
| Joined: 19 Sep 2012 |
| Total Posts: 13336 |
|
|
| 20 Dec 2014 11:49 AM |
so its this?
Service1 = game:GetService("InsertService") Service2 = game:GetService("BadgeService") GUI = script.Parent.Parent.Parent.Parent
script.Parent.MouseButton1Click:connect(function() local Player = script.Parent.Parent.Parent.Parent.Parent.Parent local Label = Player.PlayerGui.CargoGUI.Information if workspace:FindFirstChild(Player.Name.." Truck") == nil then local model = Service1:LoadAsset(script.ID.Value) local TruckName = script.Parent.Parent.Parent.NameLabel.Text model.Name = Player.Name.." Truck" modelitems = model:GetChildren() for i=1,#modelitems do print(modelitems[i].Name) end Label.Text = TruckName.." spawned." -- This works, but the truck doesn't spawn :( GUI:Remove() else Label.Text = "Delete your old truck first!" end end) |
|
|
| Report Abuse |
|
|
RobuxLife
|
  |
| Joined: 19 Sep 2012 |
| Total Posts: 13336 |
|
|
| 20 Dec 2014 11:50 AM |
| id for the model is 65741525 |
|
|
| Report Abuse |
|
|
Argelius
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 4047 |
|
|
| 20 Dec 2014 11:51 AM |
| Only replace line 13, let it insert the other lines |
|
|
| Report Abuse |
|
|
RobuxLife
|
  |
| Joined: 19 Sep 2012 |
| Total Posts: 13336 |
|
| |
|
Argelius
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 4047 |
|
|
| 20 Dec 2014 11:57 AM |
| It looks like you just added the model to your inventory. Go back and try what you had first, it should work now. |
|
|
| Report Abuse |
|
|
Argelius
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 4047 |
|
|
| 20 Dec 2014 12:03 PM |
| Is Insert() the same as model.Parent = game.Workspace? |
|
|
| Report Abuse |
|
|
RobuxLife
|
  |
| Joined: 19 Sep 2012 |
| Total Posts: 13336 |
|
|
| 20 Dec 2014 12:03 PM |
Lol wow thanks that was the problem the WHOLE time. I forgot I had to have the model!
Thanks bro |
|
|
| Report Abuse |
|
|
|
| 20 Dec 2014 12:16 PM |
| Your trying to make a Truck spawn on click? Did you make it a Model, and for example:" game.Parent.ExampleModel" Because if you would put an invalid name. It would get complicated.. Or i have a tip. Make it a Regen Button, but at the beggining (when the Player enters) it destroys the truck, and then as i said make it a Regen Button to your likings. Sorry, if i did not understand what your trying to say. Well, good luck anyway! |
|
|
| Report Abuse |
|
|