I am trying to make a troll game where you drink the cup to turn into a trollge incident.
When I become a troll the animations wont play
DevForum and other stuff.
I am changing the character from the server, then I am enabling the Animate script after adding it into the character. I also have a delay to enable it.
--// Changes Avatar \\--
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Trolls = ReplicatedStorage.Trolls
local Tools = ReplicatedStorage.Tools
script.LocalScript.Main.OnServerEvent:Connect(function(player)
local chosenTroll = Trolls:GetChildren()[math.random(1,#Trolls:GetChildren())]
warn(player.Name.."(s) troll is",chosenTroll.Name)
local character = chosenTroll:FindFirstChild("MainCharacter"):Clone()
local oldCharacter = player.Character
character:SetPrimaryPartCFrame(oldCharacter.PrimaryPart.CFrame)
character.Name = player.Name
player.Character = character
character.Parent = workspace
player:WaitForChild("Backpack"):ClearAllChildren()
local ChosenTools = Tools[chosenTroll.Name]
for _,tool in pairs(ChosenTools:GetChildren()) do
tool = tool:Clone()
tool.Parent = player:WaitForChild("Backpack")
end
local animate = Trolls[chosenTroll.Name]:FindFirstChild("Animate"):Clone()
animate.Parent = player.Character
script.Parent.Parent:Destroy()
task.wait(0.5)
animate.Disabled = false
end)
It inserts it and the Humanoid is set to R6 just like how it’s meant to be.