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: Instance.new() and Clothes

Previous Thread :: Next Thread 
TheJKM98 is not online. TheJKM98
Joined: 20 Dec 2010
Total Posts: 511
01 Feb 2014 05:47 PM
I have this:

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
local shirt = Instance.new("Shirt" , character)
shirt.Name = "Shirt"
shirt.Parent = character
shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=114303438"
print(player.Name .. " got a new shirt!")
local pants = Instance.new("Pants" , character)
pants.Name = "Pants"
pants.Parent = character
pants.PantsTemplate = "http://www.roblox.com/asset/?id=114305174"
print(player.Name .. " got some new pants!")
local p = character:GetChildren()
local h = character.Head:GetChildren()
for j = 1 , #h do
if h[j]:IsA("Decal") then
h[j].Texture = "http://www.roblox.com/asset/?id=144080495 " --Slightly altered default face
end
end
for i = 1 , #p do
if p[i]:IsA("Shirt") then
p[i].ShirtTemplate = "http://www.roblox.com/asset/?id=114303438" --Black Polo
print("Shirt ID corrected.")
elseif p[i]:IsA("Pants") then
p[i].PantsTemplate = "http://www.roblox.com/asset/?id=114305174" --Jeans
print("Pants ID corrected.")
elseif p[i]:IsA("ShirtGraphic") then
p[i]:Destroy()
print("NO TEE-SHIRT FOR YOU!")
elseif p[i]:IsA("Hat") then
p[i]:Destroy()
print("NO HAT FOR YOU!")
end
end
character:WaitForChild("Humanoid").Died:connect(function()
player.leaderstats.Money.Value = player.leaderstats.Money.Value - 400
player.leaderstats.Heat.Value = 0
end)
end)
end)

It will print everything like it does something, but the problem is that the shirt and pants don't actually exist!

I don't understand. I look in the player's character via explorer, and it isn't there!

Any ideas?

P.S. - Sorry for the repost.
Report Abuse
TheJKM98 is not online. TheJKM98
Joined: 20 Dec 2010
Total Posts: 511
02 Feb 2014 10:36 AM
No one?
Report Abuse
TheJKM98 is not online. TheJKM98
Joined: 20 Dec 2010
Total Posts: 511
02 Feb 2014 11:51 AM
I guess I say 'bump' now.

bump
Report Abuse
Vyxium is not online. Vyxium
Joined: 31 Aug 2010
Total Posts: 1020
02 Feb 2014 11:54 AM
nobody is gonna go through that entire script and debug it. please cut it down to where you think the error is
Report Abuse
TheJKM98 is not online. TheJKM98
Joined: 20 Dec 2010
Total Posts: 511
02 Feb 2014 12:01 PM
I said what the problem is:

'It will print everything like it does something, but the problem is that the shirt and pants don't actually exist!'

I gave you the entire script (40 lines) because I have absolutely no idea why the clothes don't appear in the character.
Report Abuse
xXmodzXx123 is not online. xXmodzXx123
Joined: 10 Jun 2012
Total Posts: 1874
02 Feb 2014 12:01 PM
^^^^^
Report Abuse
xXmodzXx123 is not online. xXmodzXx123
Joined: 10 Jun 2012
Total Posts: 1874
02 Feb 2014 12:03 PM
tl:dr

:/
Report Abuse
LilJoker4675 is not online. LilJoker4675
Joined: 31 Oct 2011
Total Posts: 220
02 Feb 2014 12:03 PM
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
local shirt = Instance.new("Shirt" , character)
Shirt.Name = "Shirt"
Shirt.Parent = character
Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=114303438"
print(player.Name .. " got a new shirt!")
local pants = Instance.new("Pants" , character)
Pants.Name = "Pants"
Pants.Parent = character
Pants.PantsTemplate = "http://www.roblox.com/asset/?id=114305174"
print(player.Name .. " got some new pants!")
local p = character:GetChildren()
local h = character.Head:GetChildren()
for j = 1 , #h do
if h[j]:IsA("Decal") then
h[j].Texture = "http://www.roblox.com/asset/?id=144080495 " --Slightly altered default face
end
end
for i = 1 , #p do
if p[i]:IsA("Shirt") then
p[i].ShirtTemplate = "http://www.roblox.com/asset/?id=114303438" --Black Polo
print("Shirt ID corrected.")
elseif p[i]:IsA("Pants") then
p[i].PantsTemplate = "http://www.roblox.com/asset/?id=114305174" --Jeans
print("Pants ID corrected.")
elseif p[i]:IsA("ShirtGraphic") then
p[i]:Destroy()
print("NO TEE-SHIRT FOR YOU!")
elseif p[i]:IsA("Hat") then
p[i]:Destroy()
print("NO HAT FOR YOU!")
end
end
character:WaitForChild("Humanoid").Died:connect(function()
player.leaderstats.Money.Value = player.leaderstats.Money.Value - 400
player.leaderstats.Heat.Value = 0
end)
end)
end)

Here you go. PM me if it won't work then I will make another script for you.

The script I will make will do the same thing as this.
Report Abuse
TheJKM98 is not online. TheJKM98
Joined: 20 Dec 2010
Total Posts: 511
02 Feb 2014 12:10 PM
^That didn't work.

Also, what did you do to it? That looks no different than what I said.
Report Abuse
LilJoker4675 is not online. LilJoker4675
Joined: 31 Oct 2011
Total Posts: 220
02 Feb 2014 12:15 PM
I edited some lines. That should've debugged it.... Hm. I will look over it some more.
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