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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Assets fail to load

Previous Thread :: Next Thread 
DragoonGuy is not online. DragoonGuy
Joined: 07 Aug 2009
Total Posts: 1062
22 Aug 2011 02:44 PM
I am making a body stroller GUI. Press a button to go forward to the next body, and another to go back. There are separate buttons for the torso, arms, and legs.
The script work but I am having trouble with loading up the bodies. Here is the script;

bodies = script.Parent.Parent.Database.Body:GetChildren()
torsoIndex = math.random(1, #bodies)
armIndex = math.random(1, #bodies)
legIndex = math.random(1, #bodies)
player = script.Parent.Parent.Parent.Parent.Parent

function delete(part)
p = player.Character:GetChildren()
for i=1,#p do
if p[i].ClassName == "CharacterMesh" then
if part == "Torso" and p[i].BodyPart == part then
p[i]:remove()
elseif part == "Arm" and p[i].BodyPart == "LeftArm" or "RightArm" then
p[i]:remove()
elseif part == "Leg" and p[i].BodyPart == "LeftLeg" or "RightLeg" then
p[i]:remove()
end
end
end
end

function insert(dir, part)
if dir == 1 then
if part == "Torso" then
index = torsoIndex
elseif part == "Arm" then
index = armIndex
elseif part == "Leg" then
index = legIndex
end
if index < #bodies then
index = index+1
getfenv()[string.lower(part).."Index"] = index
end
else
if index > 1 then
index = index-1
getfenv()[string.lower(part).."Index"] = index
end
end
p = game:GetService("InsertService"):LoadAsset(bodies[index].Value)
q = p:GetChildren()
for i=1,#q do
if part == "Torso" and q[i].BodyPart ~= part then
q[i]:remove()
elseif part == "Arm" and q[i].BodyPart ~= "LeftArm" or "RightArm" then
q[i]:remove()
elseif part == "Leg" and q[i].BodyPart ~= "LeftLeg" or "RightLeg" then
q[i]:remove()
end
w = q[i]
wait(1)
w.Parent = game.Workspace[player.Name]
end
end

delete("Torso"); delete("Arm"); delete("Leg");
insert(1, "Torso"); insert(1, "Arm"); insert(1, "Leg");

script.Parent.Parent.Visuals.Buttons.torsoNext.MouseButton1Down:connect(function () delete("Torso") insert(1, "Torso") end)
script.Parent.Parent.Visuals.Buttons.torsoBack.MouseButton1Down:connect(function () delete("Torso") insert(0, "Torso") end)
script.Parent.Parent.Visuals.Buttons.armNext.MouseButton1Down:connect(function () delete("Arm") insert(1, "Arm") end)
script.Parent.Parent.Visuals.Buttons.armBack.MouseButton1Down:connect(function () delete("Arm") insert(0, "Arm") end)
script.Parent.Parent.Visuals.Buttons.legNext.MouseButton1Down:connect(function () delete("Leg") insert(1, "Leg") end)
script.Parent.Parent.Visuals.Buttons.legBack.MouseButton1Down:connect(function () delete("Leg") insert(0, "Leg") end)

It outputs something like;

httpGet http://www.roblox.com/Asset/?id=32357766 failed. Trying again. Error: GZip error 4, ZLib error 0, "http://www.roblox.com/Asset/?id=32357766". Elapsed time: 1.53008 - Content failed for http://www.roblox.com/Asset/?id=32357766 because GZip error 4, ZLib error 0, "http://www.roblox.com/Asset/?id=32357766"
Report Abuse
DragoonGuy is not online. DragoonGuy
Joined: 07 Aug 2009
Total Posts: 1062
22 Aug 2011 02:53 PM
I really need this...
Report Abuse
gombob is not online. gombob
Joined: 01 May 2008
Total Posts: 5215
22 Aug 2011 03:10 PM
p = game:GetService("InsertService"):LoadAsset(bodies[index].Value)

I think this might be the problem. If you want to insert something with "id=345565633" then you have to do do id = id - 1 so you get "id=345565632".
Report Abuse
DragoonGuy is not online. DragoonGuy
Joined: 07 Aug 2009
Total Posts: 1062
22 Aug 2011 03:18 PM
Sorry; I don't understand. So what should I do?
Report Abuse
DragoonGuy is not online. DragoonGuy
Joined: 07 Aug 2009
Total Posts: 1062
22 Aug 2011 03:19 PM
D'you mean p = game:GetService("InsertService"):LoadAsset(bodies[index].Value-1)?
Report Abuse
DragoonGuy is not online. DragoonGuy
Joined: 07 Aug 2009
Total Posts: 1062
22 Aug 2011 03:24 PM
Just tried that and it's loading something else ¬_¬

Please! Somebody!
Report Abuse
DragoonGuy is not online. DragoonGuy
Joined: 07 Aug 2009
Total Posts: 1062
23 Aug 2011 09:26 AM
BUMP
Report Abuse
DragoonGuy is not online. DragoonGuy
Joined: 07 Aug 2009
Total Posts: 1062
24 Aug 2011 08:22 AM
BUMP
Report Abuse
DragoonGuy is not online. DragoonGuy
Joined: 07 Aug 2009
Total Posts: 1062
24 Aug 2011 09:04 AM
BUMP
Report Abuse
DragoonGuy is not online. DragoonGuy
Joined: 07 Aug 2009
Total Posts: 1062
24 Aug 2011 09:21 AM
BUMP
Report Abuse
builderman1171 is not online. builderman1171
Joined: 27 Mar 2010
Total Posts: 1595
24 Aug 2011 09:31 AM
If your trying to load body parts for a character changer, why not have an in-game directory of all the body parts, from there have your code extract a clone of the body parts into the character? I might not be understanding what you want exactly...
Report Abuse
DragoonGuy is not online. DragoonGuy
Joined: 07 Aug 2009
Total Posts: 1062
24 Aug 2011 10:10 AM
Yes, I was afraid I was going to have to do that. Thank you for your time anyway...
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