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 » Scripters
Home Search
 

Re: Whats wrong with this??

Previous Thread :: Next Thread 
RobuxLife is not online. 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
areno2002 is not online. areno2002
Joined: 10 Dec 2010
Total Posts: 7
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 is not online. 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 is not online. RobuxLife
Joined: 19 Sep 2012
Total Posts: 13336
20 Dec 2014 10:58 AM
Bump
Report Abuse
RobuxLife is not online. RobuxLife
Joined: 19 Sep 2012
Total Posts: 13336
20 Dec 2014 11:00 AM
Help. I might 3v3n pay, okay?
Report Abuse
RobuxLife is not online. RobuxLife
Joined: 19 Sep 2012
Total Posts: 13336
20 Dec 2014 11:03 AM
bump again
Report Abuse
RobuxLife is not online. 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 is not online. RobuxLife
Joined: 19 Sep 2012
Total Posts: 13336
20 Dec 2014 11:16 AM
...
Report Abuse
RobuxLife is not online. RobuxLife
Joined: 19 Sep 2012
Total Posts: 13336
20 Dec 2014 11:24 AM
Bump 3
Report Abuse
Argelius is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. Argelius
Joined: 19 Jul 2010
Total Posts: 4047
20 Dec 2014 11:49 AM
What model are you trying to insert?
Report Abuse
RobuxLife is not online. 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 is not online. RobuxLife
Joined: 19 Sep 2012
Total Posts: 13336
20 Dec 2014 11:50 AM
id for the model is 65741525
Report Abuse
Argelius is not online. 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 is not online. RobuxLife
Joined: 19 Sep 2012
Total Posts: 13336
20 Dec 2014 11:55 AM
Invite me to a party
Report Abuse
Argelius is not online. 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 is not online. 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 is not online. 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
iShinyCoil is not online. iShinyCoil
Joined: 03 Dec 2012
Total Posts: 165
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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