Im working on a transform button and I'd like when the player clicks on the button the second time it transforms it back into his original clothes..
the first transformation is working fine but the second transformation is not However, if i insert a print statement, its working absolutely fine. So i guess, its the values assigned as its telling me Attempt to index a nil value
local character=game.Players.LocalPlayer.Character local ogshirt = character:FindFirstChildOfClass("Shirt").ShirtTemplate local ogpants = character:FindFirstChildOfClass("Pants").PantsTemplate character.Shirt.ShirtTemplate=ogshirt character.Pants.PantsTemplate=ogpants
Maybe I should attempt to use the GetCharacterAppearanceInfoAsync??
Well, I'd say that if you put the original clothes of a character in another service (say ServerStorage
) and then create code that will put those clothes back on, that would work. In a more simple matter, you would write code to store the original clothes in ServerStorage, then when you want the character to get their normal clothes back, you could write code to get the clothes from ServerStorage.
OMG it worked!!! I put it to wait for like 5 sec and stored the shirt content into a model And then used that as reference Thanks All..