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: Shirt problem

Previous Thread :: Next Thread 
pauljkl is online. pauljkl
Joined: 23 Oct 2008
Total Posts: 9364
24 Jul 2013 01:02 PM
Well i'm having a little trouble with ShirtTemplate property, for some reason it refuses to let me change the shirt as I wish, here is the snippet:

shirt is a global variable at the top of the script

shirt = Instance.new("Shirt",player.Character)
shirt.Name = "FakeShirt"
shirt.ShirtTemplate = player.Character.Shirt.ShirtTemplate
player.Character.Shirt:Destroy()

If I change the ShirtTemplate above this point, it will allow me to change the shirt successfully, but not afterwards
later in script...

shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=82180686"

This is all in the same script. Solutions?
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
24 Jul 2013 01:44 PM
This is a bit confusing to me as well. I've rarely used the ShirtTemplate property, but I suggest looking at pre-existing scripts that alter the character's shirt, so that you can better understand what needs to happen in order to alter it.

An old and popular script is Vortex Security's automatic uniform giver script, that will essentially remove the player's shirt and pants, and replace it with a Vortex Security uniform. It worked 95% of the time.

Unfortunately I don't have a link to it. You'd have to scan the free models.

-- Soybeen

Report Abuse
compy111 is not online. compy111
Joined: 02 Apr 2009
Total Posts: 583
24 Jul 2013 01:55 PM
Maybe you are trying to change player.Character.Shirt after this while it doesn't exist since you replaced it with Player.Character.FakeShirt

Anything in output?
Report Abuse
pauljkl is online. pauljkl
Joined: 23 Oct 2008
Total Posts: 9364
24 Jul 2013 04:10 PM
Well as I explained in the original post, if I change the ShirtTemplate earlier in the script, it works, but later it doesn't. Im completely baffled by it
Report Abuse
compy111 is not online. compy111
Joined: 02 Apr 2009
Total Posts: 583
25 Jul 2013 07:24 AM
This script works, I do not know where you are using this script for but you might be able to use this. Very important is the wait() since this script loads faster than the character without it.


wait()
player = script.Parent.Parent
stuff = player.Character:GetChildren()
oldshirt = player.Character:FindFirstChild("Shirt")
if oldshirt ~= nil then
oldshirt:Destroy()
end
oldshirt = player.Character:FindFirstChild("Shirt")
if oldshirt == nil then
shirt = Instance.new("Shirt",player.Character)
shirt.Name = "FakeShirt"
shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=82180686"
end
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