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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|