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: Insert service not working :(

Previous Thread :: Next Thread 
PandaWithNoName is not online. PandaWithNoName
Joined: 10 Jul 2010
Total Posts: 78
28 Sep 2015 04:26 AM
I am having trouble getting Inset Service to work. No output errors and nothing.

What I should be doing is getting a local script to access insert service and insert a model from my inventory into the backpack of the local player:

a = game:GetService("InsertService"):LoadAsset(300873417)
a.Parent = game.Players.LocalPlayer:WaitForChild("Backpack")

OR

a.Parent = game.Players.LocalPlayer:FindFirstChild("Backpack")

none of them work :(
Report Abuse
Froast is not online. Froast
Joined: 12 Mar 2009
Total Posts: 3134
28 Sep 2015 04:32 AM
When you use InsertService to load an asset it puts it all into a model, if you don't extract it it might not work.

local backpack = game:GetService'Players'.LocalPlayer:WaitForChild'Backpack'
for _,child in next, game:GetService'InsertService':LoadAsset(300873417) do
child.Parent = backpack
end

Or, if there's only one thing in your model:

game:GetService'InsertService':LoadAsset(300873417).Parent = game:GetService'Players'.LocalPlayer:WaitForChild'Backpack'
Report Abuse
PandaWithNoName is not online. PandaWithNoName
Joined: 10 Jul 2010
Total Posts: 78
28 Sep 2015 05:18 AM
I tried, the second one since its a gun but it doesn't work. No errors but somehow is not working in my place
Report Abuse
PandaWithNoName is not online. PandaWithNoName
Joined: 10 Jul 2010
Total Posts: 78
28 Sep 2015 05:26 AM
its in a model in backpack. Do you know how to extract it?
Report Abuse
Froast is not online. Froast
Joined: 12 Mar 2009
Total Posts: 3134
28 Sep 2015 05:27 AM
Sorry the second one was supposed to be game:GetService'InsertService':LoadAsset(300873417):GetChildren()[1].Parent = game:GetService'Players'.LocalPlayer:WaitForChild'Backpack'
Report Abuse
PandaWithNoName is not online. PandaWithNoName
Joined: 10 Jul 2010
Total Posts: 78
28 Sep 2015 05:36 AM
Thanks man!
Report Abuse
PandaWithNoName is not online. PandaWithNoName
Joined: 10 Jul 2010
Total Posts: 78
28 Sep 2015 05:57 AM
Ok now I need to insert multiple guns at once into the backpack but because of that [1] its conflicting, how do i modify it since the number of guns i insert is different each time and isn't a certain amount (e.g I'd probs choose to insert 5 guns into my backpack if i press a gui button)
Report Abuse
Froast is not online. Froast
Joined: 12 Mar 2009
Total Posts: 3134
28 Sep 2015 06:00 AM
If you mean inserting all the objects in one model then use the first one (which I also made a mistake on). Fixed here:

local backpack = game:GetService'Players'.LocalPlayer:WaitForChild'Backpack'
for _,child in next, game:GetService'InsertService':LoadAsset(300873417):GetChildren() do
child.Parent = backpack
end
Report Abuse
PandaWithNoName is not online. PandaWithNoName
Joined: 10 Jul 2010
Total Posts: 78
28 Sep 2015 06:06 AM
Nope, What it does is that it only inserts one model into my backpack when I want it to insert 2. So I mean, if I have 2 or more models I want to insert at once, I have to use 2 of the codes for example.

local backpack = game:GetService'Players'.LocalPlayer:WaitForChild'Backpack'
for _,child in next, game:GetService'InsertService':LoadAsset(300873417):GetChildren() do
child.Parent = backpack
end

local backpack = game:GetService'Players'.LocalPlayer:WaitForChild'Backpack'
for _,child in next, game:GetService'InsertService':LoadAsset(300873417):GetChildren() do
child.Parent = backpack
end

BUT Im only receiving one gun not two.
Report Abuse
PandaWithNoName is not online. PandaWithNoName
Joined: 10 Jul 2010
Total Posts: 78
28 Sep 2015 06:37 AM
nvm im dumb did it wrong, works now
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