How do i make a character do an animation which changes their clothes and adds accessories to their avatar when something is said in chat? Also, when they’ve done that, they can say something else to return to their avatar form, for example:
“spots on” transforms them,
“spots off” detransforms them.
I think you should use Player | Roblox Creator Documentation and Animator | Roblox Creator Documentation and AnimationTrack | Roblox Creator Documentation and Humanoid | Roblox Creator Documentation and Instance.new
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(message)
if message == "hello" then -- put here the message that the player has to say to play the animation
local Humanoid = player.Character:FindFirstChildOfClass("Humanoid")
if Humanoid then
for _, object in pairs(player.Character:GetChildren()) do
if object:IsA("Clothing") or object:IsA("ShirtGraphic") or object:IsA("Accessory") then
object:Destroy()
end
end
Humanoid:AddAccessory(game.ServerStorage.Accessory:Clone()) -- put your accessory here
local Shirt = Instance.new("Shirt", player.Character)
Shirt.ShirtTemplate = "" -- put your shirt template here
local Pants = Instance.new("Pants", player.Character)
Pants.PantsTemplate = "" -- put your pants template here
local Animator = Humanoid:FindFirstChildOfClass("Animator")
if Animator then
local animationTrack = Animator:LoadAnimation(script.Animation) -- put your animation here
animationTrack:Play()
end
end
end
end)
end)