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: Whats wrong with this?

Previous Thread :: Next Thread 
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
12 Oct 2012 09:51 AM
game.Players.PlayerAdded:connect(function(ply)
ply.CharacterAdded:connect(function(char)
for i,v in pairs(char:GetChildren()) do
if v:IsA("Clothing") or v:IsA("ShirtGraphic") then
v:Destroy()
end
end
end)
end)



Its supposed to remove my clothes when i join...
Report Abuse
YaYaBinks3 is not online. YaYaBinks3
Joined: 05 Jun 2009
Total Posts: 2631
12 Oct 2012 10:03 AM
Clothing isn't a Class. Shirt or Pants is, though. Try that.

>Much love, YaYaBinks3.
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
12 Oct 2012 10:22 AM
game.Players.PlayerAdded:connect(function(ply)
ply.CharacterAdded:connect(function(char)
for i,v in pairs(char:GetChildren()) do
if v:IsA("Shirt") or v:IsA("Pants") then
v:Destroy()
end
end
end)
end)


It didnt work :(
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
12 Oct 2012 10:42 AM
bump
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
12 Oct 2012 10:58 AM
bump
Report Abuse
adark is not online. adark
Joined: 13 Jan 2008
Total Posts: 6412
12 Oct 2012 11:04 AM
I'm not certain, but I'm pretty sure Destroying the Shirt and Pants objects don't remove the Texture. You have to set their assets to something completely invisible for it to work.
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
12 Oct 2012 11:10 AM
Actually, i want to retexture the shirt and pants into clothes i want when i join, so how to do that?
Report Abuse
adark is not online. adark
Joined: 13 Jan 2008
Total Posts: 6412
12 Oct 2012 11:20 AM
Just change the ShirtTemplate and PantsTemplate properties to what you want.
Report Abuse
human is not online. human
Joined: 06 May 2007
Total Posts: 2765
12 Oct 2012 11:21 AM
adarks right, I think, I just made something that removed my tshirt, but the image didn't go away.
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
12 Oct 2012 11:43 AM
game.Players.PlayerAdded:connect(function(ply)
ply.CharacterAdded:connect(function(char)
char.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=82203922"
char.Pants.ShirtTemplate = "http://www.roblox.com/asset/?id=70643944"
end)
end)


Whats wrong with this?
Report Abuse
human is not online. human
Joined: 06 May 2007
Total Posts: 2765
12 Oct 2012 12:00 PM
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function()
repeat wait() until player
if player then
wait(2) --idk if my comps lagging, but the clothing won't change without the wait.
for i,v in pairs(player.Character:GetChildren()) do
if v:IsA("Shirt") then
print("shirt")
v.ShirtTemplate = "http://www.roblox.com/asset/?id=47044626"
elseif
v:IsA("Pants") then
print("pants")
v.PantsTemplate = "http://www.roblox.com/asset/?id=70643944"
end
end
end
end)
end)
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
12 Oct 2012 12:11 PM
so?:

game.Players.PlayerAdded:connect(function(ply)
ply.CharacterAdded:connect(function(char)
char.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=82203922"
char.Pants.ShirtTemplate = "http://www.roblox.com/asset/?id=70643944"
wait(2)
end)
end)


to make it simpler?
Report Abuse
human is not online. human
Joined: 06 May 2007
Total Posts: 2765
12 Oct 2012 12:12 PM
No, I made mine "harder" because it prevents errors and the script from completely breaking if something isn't there or something isn't named correctly.
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
12 Oct 2012 12:28 PM
didnt work...
Report Abuse
human is not online. human
Joined: 06 May 2007
Total Posts: 2765
12 Oct 2012 12:40 PM
idk works fine for me.
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
12 Oct 2012 12:43 PM
RLY, HOW did u test it, cuzz i didnt get different clothes:

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function()
repeat wait() until player
if player then
wait(2) --idk if my comps lagging, but the clothing won't change without the wait.
for i,v in pairs(player.Character:GetChildren()) do
if v:IsA("Shirt") then
print("shirt")
v.ShirtTemplate = "http://www.roblox.com/asset/?id=82203922"
elseif
v:IsA("Pants") then
print("pants")
v.PantsTemplate = "http://www.roblox.com/asset/?id=70643944"
end
end
end
end)
end)
Report Abuse
human is not online. human
Joined: 06 May 2007
Total Posts: 2765
12 Oct 2012 12:51 PM
play solo
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
12 Oct 2012 12:52 PM
LIER!!!!!!! i also tested solo and no work :3
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
12 Oct 2012 12:57 PM
Does elseif count as an end?
Report Abuse
Desperian is not online. Desperian
Joined: 07 Feb 2012
Total Posts: 3371
12 Oct 2012 01:01 PM
An elseif statement does not require an end. I also tested it in solo and it worked, however I could not seem to make it work online (Humans script).
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
12 Oct 2012 01:11 PM
Exactly...
Report Abuse
human is not online. human
Joined: 06 May 2007
Total Posts: 2765
12 Oct 2012 01:25 PM
if player then
for i,v in pairs(player.Character:GetChildren()) do
if v:IsA("Shirt") then

3 ends + 2 for the functions I didn't put an end for elseif

try using player:WaitForDataReady() instead
Report Abuse
human is not online. human
Joined: 06 May 2007
Total Posts: 2765
12 Oct 2012 01:26 PM
nvm about the ends, I thought you said I did. Anyways idk, the script works, but the changing of the textures is just being buggy.
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
12 Oct 2012 01:47 PM
Grr i'll just use a morph button on the spawn -.-
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